From 90257b0de107ca592c3c6a44eea67fd7169c7c47 Mon Sep 17 00:00:00 2001 From: Golmote Date: Fri, 10 Jul 2015 21:49:55 +0200 Subject: [PATCH] ActionScript: Fix XML highlighting --- components/prism-actionscript.js | 9 +++------ components/prism-actionscript.min.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/components/prism-actionscript.js b/components/prism-actionscript.js index 62d8ee5d3f..ff5804d4d3 100644 --- a/components/prism-actionscript.js +++ b/components/prism-actionscript.js @@ -1,7 +1,3 @@ -/* TODO - Fix XML highlighting - */ - Prism.languages.actionscript = Prism.languages.extend('javascript', { 'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/, 'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/ @@ -9,9 +5,10 @@ Prism.languages.actionscript = Prism.languages.extend('javascript', { Prism.languages.actionscript['class-name'].alias = 'function'; if (Prism.languages.markup) { - Prism.languages.insertBefore('actionscript', 'operator', { + Prism.languages.insertBefore('actionscript', 'string', { 'xml': { - pattern: /(^|[^.])<[\s\S]*>(?=\s*($|[\r\n,.;\]})<]))/, + pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/, + lookbehind: true, inside: { rest: Prism.languages.markup } diff --git a/components/prism-actionscript.min.js b/components/prism-actionscript.min.js index d2368bac3a..91a859074c 100644 --- a/components/prism-actionscript.min.js +++ b/components/prism-actionscript.min.js @@ -1 +1 @@ -Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","operator",{xml:{pattern:/(^|[^.])<[\s\S]*>(?=\s*($|[\r\n,.;\]})<]))/,inside:{rest:Prism.languages.markup}}}); \ No newline at end of file +Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:Prism.languages.markup}}}); \ No newline at end of file