Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into avisynth
Browse files Browse the repository at this point in the history
  • Loading branch information
Zinfidel committed Sep 15, 2021
2 parents dc48428 + ffb2043 commit b3d6a99
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 42 deletions.
17 changes: 13 additions & 4 deletions components/prism-markup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Prism.languages.markup = {
'comment': /<!--[\s\S]*?-->/,
'prolog': /<\?[\s\S]+?\?>/,
'comment': {
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
greedy: true
},
'prolog': {
pattern: /<\?[\s\S]+?\?>/,
greedy: true
},
'doctype': {
// https://www.w3.org/TR/xml/#NT-doctypedecl
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
Expand All @@ -17,11 +23,14 @@ Prism.languages.markup = {
greedy: true
},
'punctuation': /^<!|>$|[[\]]/,
'doctype-tag': /^DOCTYPE/,
'doctype-tag': /^DOCTYPE/i,
'name': /[^\s<>'"]+/
}
},
'cdata': /<!\[CDATA\[[\s\S]*?\]\]>/i,
'cdata': {
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
greedy: true
},
'tag': {
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
greedy: true,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-markup.min.js

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

1 change: 1 addition & 0 deletions plugins/previewers/prism-previewers.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
width: 32px;
height: 32px;
margin-left: -16px;
z-index: 10;

opacity: 0;
-webkit-transition: opacity .25s;
Expand Down
17 changes: 13 additions & 4 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -1231,8 +1231,14 @@ if (typeof global !== 'undefined') {
********************************************** */

Prism.languages.markup = {
'comment': /<!--[\s\S]*?-->/,
'prolog': /<\?[\s\S]+?\?>/,
'comment': {
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
greedy: true
},
'prolog': {
pattern: /<\?[\s\S]+?\?>/,
greedy: true
},
'doctype': {
// https://www.w3.org/TR/xml/#NT-doctypedecl
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
Expand All @@ -1249,11 +1255,14 @@ Prism.languages.markup = {
greedy: true
},
'punctuation': /^<!|>$|[[\]]/,
'doctype-tag': /^DOCTYPE/,
'doctype-tag': /^DOCTYPE/i,
'name': /[^\s<>'"]+/
}
},
'cdata': /<!\[CDATA\[[\s\S]*?\]\]>/i,
'cdata': {
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
greedy: true
},
'tag': {
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
greedy: true,
Expand Down
36 changes: 3 additions & 33 deletions themes/prism-twilight.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection {
cursor: help;
}

pre[data-line] {
padding: 1em 0 1em 3em;
position: relative;
}

/* Markup */
.language-markup .token.tag,
.language-markup .token.attr-name,
Expand All @@ -158,42 +153,17 @@ pre[data-line] {
z-index: 1;
}

.line-highlight {
.line-highlight.line-highlight {
background: hsla(0, 0%, 33%, 0.25); /* #545454 */
background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */
border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */
border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */
left: 0;
line-height: inherit;
margin-top: 0.75em; /* Same as .prism’s padding-top */
padding: inherit 0;
pointer-events: none;
position: absolute;
right: 0;
white-space: pre;
z-index: 0;
}

.line-highlight:before,
.line-highlight[data-end]:after {
.line-highlight.line-highlight:before,
.line-highlight.line-highlight[data-end]:after {
background-color: hsl(215, 15%, 59%); /* #8794A6 */
border-radius: 999px;
box-shadow: 0 1px white;
color: hsl(24, 20%, 95%); /* #F5F2F0 */
content: attr(data-start);
font: bold 65%/1.5 sans-serif;
left: .6em;
min-width: 1em;
padding: 0 .5em;
position: absolute;
text-align: center;
text-shadow: none;
top: .4em;
vertical-align: .3em;
}

.line-highlight[data-end]:after {
bottom: .4em;
content: attr(data-end);
top: auto;
}

0 comments on commit b3d6a99

Please sign in to comment.