Skip to content

Commit

Permalink
reST: Fixed inline pattern (#2946)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Jun 22, 2021
1 parent b4ac061 commit a7656de
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
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", "``"]
]]
]

0 comments on commit a7656de

Please sign in to comment.