thiht / markdown-viewer Goto Github PK
View Code? Open in Web Editor NEWFirefox add-on to view markdown files
Home Page: https://addons.mozilla.org/fr/firefox/addon/markdown-viewer/
License: MIT License
Firefox add-on to view markdown files
Home Page: https://addons.mozilla.org/fr/firefox/addon/markdown-viewer/
License: MIT License
Hi,
I came up with a solution based on https://developer.mozilla.org/en/XUL_School/DOM_Building_and_HTML_Insertion to be able to upload to http://addons.mozilla.org/.
If you are interested I can submit a pull request.
I changed install rdf to
em:id{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/em:id em:minVersion4.0/em:minVersion em:maxVersion66.0/em:maxVersionbut firefox still does not allow me to install my local build, complaining "is not compatible". Could you give me a hint please?
Thank you
Say I visit a markdown file and click an internal link, so the URL ends like doc.md#toc_1
. Refreshing or reopening this URL, markdown viewer won't work.
Relative links seems to be not working.
I tried this in a *.md
file : [a link to another article](news2.md)
a unfortunately the link to news2.md was not working.
That should be fixed. Then Firefox + markdown-viewer becomes the simplest way for setting up a small personal wiki !
It would be interested to add a favicon
It would be great to support Markdown emojis, specifically the GitHub set:
Is it possible to make the plugin nearest GitHub Flavored Markdown
this plugin destroys already parsed Markdown files like README.md on github
Maybe the file extention is not registered to Firefox in Mac OS X?
The version I have of the add-on seems to mess up the following:
After debugging a bit, I tracked tracked the problem down to this addon (version 1.6). After disabling everything's fine.
That would be great to allow the editing of the css to personalise how the markdown is rendered.
I always see the open file dialog. I bisected the regression to 1d9da0e.
Try directly open this link (not via clicking from here which uses pjax) https://github.com/Thiht/markdown-viewer/blob/master/README.md . This URL endswith .md
so it's treated as markdown.
Please, support colspan and rowspan to join table cells.
See also http://etherealmind.com/who-am-i/markdown-reference/ and http://talk.commonmark.org/t/tables-in-pure-markdown/81/47 and search for "span".
Hello,
Thank you for a very useful extension. I saw that the latest version supports GFM so I used your instructions to build the .xpi and installed it. However, I don't seem to get checkboxes when I open the .md file in Firefox.
Is this the default behaviour or is something wrong with my setup?
Thanks!
I've just tested 1.10 and #22 is now solved, but it works only with links for non-local files (uploaded to an actual website). Can we please have it work with local files as well (saved on the local file system)?
Thanx for considering this.
CHANGELOG.txt has not been updated since November 2013 and its entries do not include version numbers.
Could there be a way to automate this like for example have it be auto-generated from the commit log? If not, can you then update your release procedure to include a step to update the file before release?
Also, it would be great to keep AMO.org release page up to date too since that's where most people download the addon from..
It would be nice if alignment with :
worked as in
https://help.github.com/articles/github-flavored-markdown/#tables
(currently, always left-aligned)
Example from there:
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
Any plans to make a "no restart" version ?
https://developer.mozilla.org/en-US/Add-ons/Bootstrapped_extensions
https://developer.mozilla.org/en-US/Add-ons/How_to_convert_an_overlay_extension_to_restartless
This:
[Synecdoche, New York (2008)](http://google.com/search?q=Synecdoche,+New+York+(2008)+imdb&btnI)
Outputs this:
Synecdoche, New York (2008)+imdb&btnI)
Instead of this:
Synecdoche, New York (2008)
Following #20 and #46, + the fact Mozilla is progressively deprecating XUL extensions, it becomes urgent to transition to another solution.
The two solutions are the Jetpack SDK and WebExtensions.
WebExtensions don't allow mime-type registering (yet?) so they're not an option for now.
As always, bhollis/jsonview is a good source of inspiration since it does the same thing as Markdown Viewer but for JSON :)
Important things to check along the development:
Using version 1.8.1 on Pale Moon (25.8.1.x64) sends file load into an endless loop as it seems. Not a big deal, but since PM is the better FF it is the preferred platform.
It used to work in previous versions but it's broken with the latest versions of Firefox (probably Firefox 27 or 28) so I removed it for now.
I'll try to figure out how to load a chrome js file after the page loaded.
It can't parse vowel mutation like ä, ö, ü and ß, ...
Rendering doesn't work when opening a .md file with Firefox developper edition (43.0a2).
I did some debugging that shows that an exception is raised on loading:
NS_ERROR_XPC_CANT_PASS_CPOW_TO_NATIVE
It's illegal to pass a CPOW to native code arg 4 [nsIParserUtils.parseFragment]
parseHTML@chrome://markdown-viewer/content/markdown-viewer.js:38:1
MarkdownViewer.onPageLoad@chrome://markdown-viewer/content/markdown-viewer.js:84:20
EventTargetParent.dispatch/<@resource://gre/modules/RemoteAddonsParent.jsm:564:15
Prefetcher.withPrefetching@resource://gre/modules/Prefetcher.jsm:460:14
EventTargetParent.dispatch@resource://gre/modules/RemoteAddonsParent.jsm:560:11
EventTargetParent.receiveMessage@resource://gre/modules/RemoteAddonsParent.jsm:508:1
And there are lots of unsafe CPOW usage
messages in the console.
So, the problem seems to appear with multiprocess versions of Firefox.
I use Markdown Viewer 1.8.1-signed.
According to this article it seems that issues between plugins and CPOW can happen but are solvable. Maybe this MDN page contains helpfull informations.
This issue is related to issues #41 and #42 but I am creating a new one with a more appropriate title. I hope it's ok!
I wish to use javascript in an md file. I was able to do what I needed by attaching javascript to an onclick attribute of a button. This no longer seems to work. Is there any other way?
window.oldSetTimeout=window.setTimeout;window.setTimeout=function(func,delay){return window.oldSetTimeout(function(){try{if(!document.documentElement.getAttribute('stopTimers')){if(typeof func=='string') {var nfunc = new Function(func); nfunc();} else func();}}catch(ex){}},delay);}; window.oldSetInterval=window.setInterval;window.setInterval=function(func,delay){return window.oldSetInterval(function(){try{if(!document.documentElement.getAttribute('stopTimers')){if(typeof func=='string') {var nfunc = new Function(func); nfunc();} else func();}}catch(ex){}},delay);}; Description
I installed the add-on but cannot figure out how to use it. I have a .md file but if I do File>Open, Firefox asks what to do with this? "Open with Xcode (default)", DownThemAll!, Save File?
I cannot see how to get a Firefox window containing .md source, as shown in your screen shot. And if I do, how then do I say, "render this"?
The generated HTML title is always the same. When you have several MD files open you can not see which tab is which file.
Issue and FIX (BELOW): Printing clips content for long lines due to a hardcoded CSS value,width: 940px; For example a paragraph with a lot of words will not wrap lines but each of the wrapped lines gets clipped so we loose some text on the right side.
I have this issue on Ubuntu 14.04 running firefox 38.0 using your plugin version 1.8.1
This is caused because markdown-viewer.css has a hardcoded
body {
...
width: 940px;
}
So I changed to
width: 90%;
YIPPIE!!
With a one-line fix, now I can print PORTRAIT or LANDSCAPE and paragraphs are not clipped when printing. Also the 90% makes nicer when viewing on screen.
Cheers,
-- [email protected]
After the update to FF 34.0.5 whenever I try to open a local .md
file, it prompts me with what I want to open it (let's say emacs) rather than viewing it in the browser itself.
When .md file is opened locally, and it doesn't contain utf-8 BOM, Firefox traits encoding as ascii.
Please, consider specifying the default encoding as utf-8.
Many of the popular markdown-implementations use YAML for metadata. Currently, the extension thinks that YAML-metadata should be parsed just like the rest of the text. A perfect implementation would be to parse the YAML-metadata correctly, but a sufficient solution to previewing would be to ignore the YAML completely.
As per #5 the HTML title should be the first line of the file. However, if I read https://github.com/Thiht/markdown-viewer/blob/master/chrome/content/markdown-viewer.js#L90 correctly, it is set to the first 50 characters of the file, which yields garbage on short titles.
Moreover, you could parse a pandoc metadata block http://pandoc.org/README.html#metadata-blocks for filling the title field.
This plugin seems to break error pages (e.g. SSL / 404 errors) if the URL contains the substring ".md".
For example:
https://iamnotmarkdown.mdnotmarkdown.bug
I incorrectly raised this as a Firefox bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1157756), but then found that disabling this extension fixed it.
I write this one
| state | endtime | Hello |
|-------|---------|-------|
| as | asd | gds |
| ada | asaf | gsfsd |
but not work.
The plugin works great so long as the extension is *.mdown, but *.md is what I generally use.
EDIT: I noticed you have already noted this in BUGS
. I guess this makes it official ;)
I will add (as you probably suspect) that this behaviour is observed on Ubuntu Linux 12.04 LTS.
There's a compatibility note when submitting the add-on to addons.mozilla:
Avertissement: This add-on uses nsIScriptableUnescapeHTML, which has been deprecated in Gecko 13 in favor of the nsIParserUtils interface. While it will continue to work for the foreseeable future, it is recommended that you change your code to use nsIParserUtils as soon as possible.
See bug https://bugzilla.mozilla.org/show_bug.cgi?id=650784 for more information.
It's located inchrome/content/markdown-viewer.js
:return Components.classes["@mozilla.org/feed-unescapehtml;1"] .getService(Components.interfaces.nsIScriptableUnescapeHTML) .parseFragment(html, !!isXML, baseURI, doc.documentElement);
EDIT: Drop it, it's already taken in consideration in the code with a conditional use of the new interface if it's available only.
Enabled but not work.
Opening a markdown file with accentuated characters results in these characters not being displayed properly. Some examples below
consécutifs -> consécutifs
où -> où
If an anchor is placed in the link, viewing're not done
file:///C:/Users/XXXXXXXX/AppData/Roaming/Sublime%20Text%202/Packages/TODO-Marker/README.md#bug
please only try to render pages that are delivered using a text/...
mime type except of text/xml
and text/xml+xhtml
.
reason: some XHTML and HTML pages have an URL ending in .md
, and we shouldn’t render those as they are likely renderings of markdown documents, anyway, and are made unreadable.
Hello!
Sorry for the noise - I just want to thank you for this remarkably easy and useful addon. it's absolutely cool!
👍
Even though the markdown standard don't specify it, it is unavoidable in every day writing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.