Markdown Viewer / Browser Extension
|
|
8 years ago | |
|---|---|---|
| background | 8 years ago | |
| content | 8 years ago | |
| css | 8 years ago | |
| images | 8 years ago | |
| test | 8 years ago | |
| themes | 8 years ago | |
| vendor | 8 years ago | |
| .editorconfig | 9 years ago | |
| LICENSE | 8 years ago | |
| README.md | 8 years ago | |
| manifest.json | 8 years ago |
Install: Chrome Store / Donate: PayPal
chrome://extensionsAllow access to file URLs checkbox is checked for the Markdown Viewer extension| Option | Default | Description |
|---|---|---|
| breaks | false |
Enable GFM line breaks. This option requires the gfm option to be true. |
| gfm | true |
Enable GFM GitHub Flavored Markdown. |
| pedantic | false |
Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior. |
| sanitize | false |
Sanitize the output. Ignore any HTML that has been input. |
| smartLists | false |
Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic. |
| smartypants | false |
Use "smart" typographic punctuation for things like quotes and dashes. |
| tables | true |
Enable GFM tables. This option requires the gfm option to be true. |
| Option | Default | Description |
|---|---|---|
| breaks | false |
Enable GFM line breaks. This option requires the gfm option to be true. |
| commonmark | false |
Toggle CommonMark mode. |
| footnotes | false |
Toggle reference footnotes and inline footnotes. |
| gfm | true |
Enable GFM GitHub Flavored Markdown. |
| pedantic | false |
Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior. |
| sanitize | false |
Sanitize the output. Ignore any HTML that has been input. |
| Option | Default | Description |
|---|---|---|
| emoji | false |
Convert emoji :shortnames: into EmojiOne images |
| scroll | true |
Remember scroll position |
| toc | false |
Generate Table of Contents |
| mathjax | false |
Render TeX and LaTeX math blocks |
scroll option remembers the current scroll position and scrolls back to it after page load.scroll option either scrolls to the top of the document or to a certain header (anchor) if a hash URL fragment is present.The following mathjax delimiters are supported:
\(math\) and $math$\[math\] and $$math$$The following rules apply to your content when mathjax is enabled:
$ in text that is not part of a math formula should be escaped: \$\( and \), and brackets: \[ and \] is not supported. MathJax will convert anything between these delimiters to math formulas, unless they are wrapped in backticks: `\(` or fenced code blocks.The MathJax support currently works only for local file URLs and remote origins without strict Content Security Policy (CSP) set. For example it won't work for files hosted on GitHub.
:sparkles: will be converted to :sparkles: using EmojiOne images.✨ and ASCII emoji like :D are not supported.The Emoji support currently works only for local file URLs and remote origins without strict Content Security Policy (CSP) set. For example it won't work for files hosted on GitHub.
Detecting and rendering local file URLs can be enabled by using the Allow access to file URLs option for the extension.
Access to remote URLs however, needs to be enabled manually.
Here is how you can enable the extension for the https://raw.githubusercontent.com origin:
The origin consists of protocol part and domain part. The protocol can be either https, http, or a * to match both https and http.
Enable the above origin and play around with the extension options here.
In case you really want to you can enable the extension for all origins:
Alternatively you can use the Allow All button.
Note that the remote origins should either provide a valid HTTP header (see Header Detection) and/or valid URL path (see Path Matching). Otherwise you'll have to add the origin explicitly and set its Path Matching regular expression.
When this option is enabled the extension will check for the text/markdown and text/x-markdown content-type header before trying to match the path:
If the header detection is disabled or a proper content-type header is missing, the extension will check if the URL is ending with a markdown file extension:
It's a simple regular expression that matches URLs ending with:
\.(?:markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text)(?:#.*|\?.*)?The
?:used in(?:match)stands for non-capturing group and it's there for performance reasons.
You can modify the path matching regular expression for each enabled origin individually. The settings are being updated as you type.
At any point click on the small x button next to the origin that you want to remove. This actually removes the permission itself so that the extension is no longer able to inject scripts into that origin.
Note that the Chrome's consent popup shows up only when you add the origin for the first time. In case you re-add it you'll no longer see that popup. That's a Chrome thing and it's not controllable through the extension.
The extension synchronizes your preferences across all your devices using Google Sync. The list of your allowed origins is being synced too, but the actual permissions that you give using the Chrome's consent popup cannot be synced.
In case you've recently added a new origin on one of your devices you'll have to explicitly allow it on your other devices. The little refresh button next to each origin is used for that.
A few files located in the test folder of this repo can be used to test what's possible with Markdown Viewer:
raw.githubusercontent.com origin through the Advanced OptionsCompiler and Content optionsMarkdown/HTML button to switch between raw markdown and rendered HTMLDefaults button to reset back the compiler optionsMarkdown Viewer can be used with any markdown parser/compiler. Currently the following compilers are implemented: marked, remark, showdown, markdown-it, remarkable, commonmark, markdown-js.
chrome://extensionsDeveloper mode checkbox is checked at the topLoad unpacked extension... button and select the cloned directoryThe MIT License (MIT)
Copyright (c) 2013-2017 Simeon Velichkov [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.