This is a fix for #17.
The regex for table matching is extended to allow spaces and tabs as prefixes for the horizontal divider between head and body.
Also added the .. elements around the
elements and the | ... around the elements
opened by joukestoel 0
(This is wrapped in a code block to not have the example markdown parsed)
Input:
```before $& after```
Expected output:
<code>before $& after</code>
Actual output:
<code>
before
```before $& after```amp; after</code>
The special $& pattern which inserts a matched substring from a regex when present in the 2nd argument of replace() is being evaluated during execution.
If 2 or more $& match substitution strings are present in the code block, they are recursively evaluated and will cause micromarkdown.js to hang the browser.
Briefly examining the code,
#before $& after
_before $& after_
[before $& after](http://example.com) --warning: will hang browser
will also trigger this behaviour.
opened by lordastley 0
I know this project is dead, so I'm leaving this here more for anyone else that runs into the issue, rather than expecting it to be fixed. But the parser fails on single characters, for example:
Am **I** bold? will not properly place the I into bold tags. You can observe this on the test page.
This appears to fail for bold, italics and delete. Maybe others, but those were the ones I tested.
opened by photonstorm 0
One only underscore in the url works but if you have an url with more than one underscore fail:
http://something.com/something_more works ! but
http://something.com/something_more_else does not work :(
opened by yaplas 0
As mentioned at the bottom of this issue: https://github.com/SimonWaldherr/micromarkdown.js/issues/6
The commit https://github.com/SimonWaldherr/micromarkdown.js/commit/e2ea70044f916edd0fcee76f66acadabf410c3f4 doesn't seem to have found its way into the NPM package.
It would be lovely if this was updated.
opened by scandox 0
![alt](http://example.com/test_an_image.jpg) doesn't work, apparently because the two underscores in the URL are being interpreted as Markdown italics. Instead you get the verbatim text with underscores removed (or if viewed in the right context, "an" in italics)
opened by davidearl 0
Partial URLs containing only one slash and no periods cause the Javascript to blow up. E.g.
[example](/example)
produces a Javascript error in mmdCSSclass because urlTmp only has one element, so you try to access urlTemp[-1]
Actually
[example](example)
is perfectly valid too, and would blow up earlier because urlTemp[1] does not exist
It looks like this is only trying to set a class on links, so I can probably work round this with strict=true, but that's not in your documentation.
opened by davidearl 1
In line 249 there should be spaces before and after the link:
str = str.replace(stra[0], ' <a ' + micromarkdown.mmdCSSclass(repstr, strict) + 'href="' + repstr + '">' + repstr + '</a> ');
because the regex captures them and they get removed after replacement:
url2: /[ \t\n]([a-zA-Z]{2,16}:\/\/[a-zA-Z0-9@:%_\+.~#?&=]{2,256}.[a-z]{2,4}\b(\/[\-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?)[ \t\n]/g
opened by ershov 2
Convert MDX to Markdown.
mdx-to-md Convert MDX to Markdown. Why? This library is most useful for generating README.md files like the one you're reading. Install yarn add mdx-t
39 Dec 1, 2022
0 Mar 1, 2022
3 Mar 23, 2022
8 Apr 13, 2022
4 Apr 25, 2022
8 Oct 24, 2022
8 Nov 1, 2022
65 Dec 11, 2022
4 Nov 16, 2022
2 Sep 19, 2022
91 Jan 2, 2023
25 Dec 20, 2022
7 Dec 13, 2022
13 Jan 2, 2023
2 Oct 19, 2020
Convert JSON to human readable HTML
json.human.js: Json Formatting for Human Beings A small library to convert a JSON object into a human readable HTML representation that is easy to sty
955 Dec 3, 2022
11 Nov 6, 2022
4.3k Dec 31, 2022
7 Dec 19, 2022
|