@progfay/scrapbox-parser
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -5,3 +5,3 @@ "use strict"; | ||
const strongImageRegExp = /^(?<left>.*?)\[\[(?<src>https?:\/\/[^\s\]]+\.(png|jpe?g|gif|svg))\]\](?<right>.*)$/i; | ||
const gyazoStrongImageRegExp = /^(?<left>.*?)\[\[(?<src>https?:\/\/([0-9a-z\-]+\.)?gyazo\.com\/[0-9a-f]{32})\]\](?<right>.*)$/; | ||
const gyazoStrongImageRegExp = /^(?<left>.*?)\[\[(?<src>https?:\/\/([0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32})\]\](?<right>.*)$/; | ||
const isStrongImageMatch = (obj) => (obj && obj.groups && obj.groups.src); | ||
@@ -19,3 +19,3 @@ const createStrongImageNode = (src) => ({ | ||
const { left, src, right } = StrongImageMatch.groups; | ||
const isGyazoImage = /https?:\/\/([0-9a-z\-]+\.)?gyazo\.com\/[0-9a-f]{32}/.test(src); | ||
const isGyazoImage = /https?:\/\/([0-9a-z-]+\.)?gyazo\.com\/[0-9a-f]{32}/.test(src); | ||
return [ | ||
@@ -22,0 +22,0 @@ ..._1.convertToLineNodes(left, { nested, quoted }), |
@@ -15,3 +15,3 @@ "use strict"; | ||
const createUrlNode = (href, content) => { | ||
if (!isUrl(content) && !isImageUrl(href)) | ||
if (!(isUrl(content) && isImageUrl(content)) && !isImageUrl(href)) | ||
return ExternalLinkNode_1.createExternalLinkNode(href, content); | ||
@@ -18,0 +18,0 @@ if (isImageUrl(content)) |
{ | ||
"name": "@progfay/scrapbox-parser", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "parse Scrapbox notation to JavaScript Object", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
62801