Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown: Fixed headers #1557

Merged
merged 7 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
===========
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for the example in your PR comment?

Überschrift
-----------

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, I cannot do because of the way .test files are parsed, so I added a similar test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Looks like we had a similar test already but no harm in another.


Ü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.