mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(metadata): allow whitespaces after closing marks
Co-authored-by: Estevão Soares dos Santos <estevao.santos@gmail.com>
This commit is contained in:
parent
3eff10bbbf
commit
0d3ca4da5a
9911
package-lock.json
generated
9911
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -34,12 +34,12 @@ showdown.subParser('makehtml.metadata', function (text, options, globals) {
|
|||
});
|
||||
}
|
||||
|
||||
text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
|
||||
text = text.replace(/^\s*«««+\s*(\S*?)\n([\s\S]+?)\n»»»+\s*\n/, function (wholematch, format, content) {
|
||||
parseMetadataContents(content);
|
||||
return '¨M';
|
||||
});
|
||||
|
||||
text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
|
||||
text = text.replace(/^\s*---+\s*(\S*?)\n([\s\S]+?)\n---+\s*\n/, function (wholematch, format, content) {
|
||||
if (format) {
|
||||
globals.metadata.format = format;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<p><strong>some</strong> markdown text</p>
|
||||
<ul>
|
||||
<li>a list</li>
|
||||
<li>another list ---</li>
|
||||
<li>and stuff</li>
|
||||
</ul>
|
||||
<p>a paragraph --- with dashes</p>
|
||||
<hr />
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
title: This is the document title
|
||||
language: en
|
||||
author: Tivie
|
||||
|
||||
---
|
||||
**some** markdown text
|
||||
|
||||
- a list
|
||||
- another list ---
|
||||
- and stuff
|
||||
|
||||
a paragraph --- with dashes
|
||||
|
||||
---
|
|
@ -100,6 +100,8 @@ describe('makeHtml() features testsuite', function () {
|
|||
converter = new showdown.Converter({openLinksInNewWindow: true});
|
||||
} else if (testsuite[i].name === '#355.simplifiedAutoLink-URLs-inside-parenthesis-followed-by-another-character-are-not-parsed-correctly') {
|
||||
converter = new showdown.Converter({simplifiedAutoLink: true});
|
||||
} else if (testsuite[i].name === '#709.allow-whitespaces-after-end-in-metadata') {
|
||||
converter = new showdown.Converter({metadata: true});
|
||||
} else if (testsuite[i].name === 'relativePathBaseUrl') {
|
||||
converter = new showdown.Converter({relativePathBaseUrl: 'http://my.site.com/'});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user