0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Merge pull request #4925 from dbalders/Script_AutoLink

Added <script> to Not Auto Link and Added Test
This commit is contained in:
Hannah Wolfe 2015-02-17 20:01:14 +00:00
commit 6c701ff7f1
2 changed files with 5 additions and 1 deletions

View file

@ -114,7 +114,7 @@
}
// Extract pre blocks
text = text.replace(/<(pre|code)>[\s\S]*?<\/(\1)>/gim, function (x) {
text = text.replace(/<(pre|code|script)>[\s\S]*?<\/(\1)>/gim, function (x) {
var hash = hashId();
preExtractions[hash] = x;
return '{gfm-js-extract-pre-' + hash + '}';

View file

@ -152,6 +152,10 @@ describe('Ghost GFM showdown extension', function () {
input: '<script type="text/javascript" src="http://google.co.uk"></script>',
output: /^<script type=\"text\/javascript\" src=\"http:\/\/google.co.uk\"><\/script>$/
},
{
input: '<script>var url = "http://google.co.uk"</script>',
output: /^<script>var url = \"http:\/\/google.co.uk\"<\/script>$/
},
{
input: '<a href="http://facebook.com">http://google.co.uk</a>',
output: /^<a href=\"http:\/\/facebook.com\">http:\/\/google.co.uk<\/a>$/