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

reST: Fixed inline pattern #2946

Merged
merged 3 commits into from
Jun 22, 2021
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-rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Prism.languages.rest = {

'inline': [
{
pattern: /(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s).*?\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,
pattern: /(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s)(?:(?!\2).)*\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,
lookbehind: true,
inside: {
'bold': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-rest.min.js

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

33 changes: 33 additions & 0 deletions tests/languages/rest/issue2940.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
`ALTER ROLE <https://www.postgresql.org/docs/12/sql-alterrole.html>`_ or ``ALTER_ROLE``

`ALTER ROLE <https://www.postgresql.org/docs/12/sql-alterrole.html>`_
or ``ALTER_ROLE``

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

[
["link", [
["punctuation", "`"],
"ALTER ROLE <https://www.postgresql.org/docs/12/sql-alterrole.html>",
["punctuation", "`_"]
]],
" or ",
["inline", [
["punctuation", "``"],
["inline-literal", "ALTER_ROLE"],
["punctuation", "``"]
]],

["link", [
["punctuation", "`"],
"ALTER ROLE <https://www.postgresql.org/docs/12/sql-alterrole.html>",
["punctuation", "`_"]
]],

"\nor ",
["inline", [
["punctuation", "``"],
["inline-literal", "ALTER_ROLE"],
["punctuation", "``"]
]]
]