@citation-js/plugin-bibtex
Advanced tools
Comparing version 0.5.0-alpha.7 to 0.5.0-alpha.8
@@ -29,3 +29,4 @@ import getBibTeXJSON from './json'; | ||
function serializeRichTextValue(value) { | ||
let tokens = value.split(/<(\/.*?|i|b|sc|sup|sub|span.*?)>/g); | ||
const closingTags = []; | ||
let tokens = value.split(/<(\/?(?:i|b|sc|sup|sub|span)|span .*?)>/g); | ||
tokens = tokens.map((token, index) => { | ||
@@ -35,5 +36,9 @@ if (index % 2 === 0) { | ||
} else if (token in richTextMappings) { | ||
closingTags.push('/' + token.split(' ')[0]); | ||
return richTextMappings[token]; | ||
} else if (token === closingTags[closingTags.length - 1]) { | ||
closingTags.pop(); | ||
return '}'; | ||
} else { | ||
return '}'; | ||
return ''; | ||
} | ||
@@ -40,0 +45,0 @@ }); |
@@ -40,3 +40,4 @@ "use strict"; | ||
function serializeRichTextValue(value) { | ||
let tokens = value.split(/<(\/.*?|i|b|sc|sup|sub|span.*?)>/g); | ||
const closingTags = []; | ||
let tokens = value.split(/<(\/?(?:i|b|sc|sup|sub|span)|span .*?)>/g); | ||
tokens = tokens.map((token, index) => { | ||
@@ -46,5 +47,9 @@ if (index % 2 === 0) { | ||
} else if (token in richTextMappings) { | ||
closingTags.push('/' + token.split(' ')[0]); | ||
return richTextMappings[token]; | ||
} else if (token === closingTags[closingTags.length - 1]) { | ||
closingTags.pop(); | ||
return '}'; | ||
} else { | ||
return '}'; | ||
return ''; | ||
} | ||
@@ -51,0 +56,0 @@ }); |
{ | ||
"name": "@citation-js/plugin-bibtex", | ||
"version": "0.5.0-alpha.7", | ||
"version": "0.5.0-alpha.8", | ||
"description": "Plugin for BibTeX formats for Citation.js", | ||
@@ -45,3 +45,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a12d31a64f77a923f9d39fddba6eed81c7dc5216" | ||
"gitHead": "8e4b7744798d8b299d0b2f5dc097f6045280f161" | ||
} |
99142
2416