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

Added Script to Not Auto Link and Added Test

Closes #4922

* Added script to not be parsed to auto linking
* Added test to make sure urls inside
This commit is contained in:
David Balderston 2015-02-16 14:28:43 -08:00
parent 81fd5f9eaf
commit 6648a17ae2
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>$/