Skip to content

Commit

Permalink
Fixed Markdown headers (#1557)
Browse files Browse the repository at this point in the history
This PR fixed markdown header of the form:

```
Überschrift
-----------
```
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Nov 28, 2018
1 parent 2864fe2 commit c658429
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/prism-bash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Prism.languages.insertBefore('markdown', 'prolog', {

// title 2
// -------
pattern: /\w+.*(?:\r?\n|\r)(?:==+|--+)/,
pattern: /\S.*(?:\r?\n|\r)(?:==+|--+)/,
alias: 'important',
inside: {
punctuation: /==+$|--+$/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-markdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,4 +906,4 @@ Prism.languages.js = Prism.languages.javascript;
self.Prism.fileHighlight();
});

})();
})();
4 changes: 3 additions & 1 deletion tests/languages/markdown/hr_feature.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
***

---

* * *

----------------------------------------------------
Expand All @@ -12,4 +14,4 @@

----------------------------------------------------

Checks for hr.
Checks for hr.
10 changes: 9 additions & 1 deletion tests/languages/markdown/title_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ title 1
foobar
======

Überschrift
===========

Überschrift
--

title 2
--

Expand All @@ -19,6 +25,8 @@ title 2
[
["title", ["title 1\r\n", ["punctuation", "=="]]],
["title", ["foobar\r\n", ["punctuation", "======"]]],
["title", ["Überschrift\r\n", ["punctuation", "==========="]]],
["title", ["Überschrift\r\n", ["punctuation", "--"]]],
["title", ["title 2\r\n", ["punctuation", "--"]]],

["title", [["punctuation", "#"], " title 1"]],
Expand All @@ -31,4 +39,4 @@ title 2

----------------------------------------------------

Checks for titles.
Checks for titles.

0 comments on commit c658429

Please sign in to comment.