diff --git a/client/components/Reader/TextPage/DrawHelper.js b/client/components/Reader/TextPage/DrawHelper.js index 496a7b2b..c48e69f7 100644 --- a/client/components/Reader/TextPage/DrawHelper.js +++ b/client/components/Reader/TextPage/DrawHelper.js @@ -77,9 +77,15 @@ export default class DrawHelper { let j = 0; //формируем строку for (const part of line.parts) { - let tOpen = (part.style.bold ? '' : ''); + let tOpen = ''; + tOpen += (part.style.bold ? '' : ''); tOpen += (part.style.italic ? '' : ''); - let tClose = (part.style.italic ? '' : ''); + tOpen += (part.style.sup ? '' : ''); + tOpen += (part.style.sub ? '' : ''); + let tClose = ''; + tClose += (part.style.sub ? '' : ''); + tClose += (part.style.sup ? '' : ''); + tClose += (part.style.italic ? '' : ''); tClose += (part.style.bold ? '' : ''); let text = ''; diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 7c11260f..028991c0 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -285,7 +285,7 @@ export default class BookParser { sectionLevel++; } - if (tag == 'emphasis' || tag == 'strong') { + if (tag == 'emphasis' || tag == 'strong' || tag == 'sup' || tag == 'sub') { growParagraph(`<${tag}>`, 0); } @@ -343,7 +343,7 @@ export default class BookParser { sectionLevel--; } - if (tag == 'emphasis' || tag == 'strong') { + if (tag == 'emphasis' || tag == 'strong' || tag == 'sup' || tag == 'sub') { growParagraph(``, 0); } @@ -507,7 +507,7 @@ export default class BookParser { splitToStyle(s) { let result = [];/*array of { - style: {bold: Boolean, italic: Boolean, center: Boolean, space: Number}, + style: {bold: Boolean, italic: Boolean, sup: Boolean, sub: Boolean, center: Boolean, space: Number}, image: {local: Boolean, inline: Boolean, id: String}, text: String, }*/ @@ -530,6 +530,12 @@ export default class BookParser { case 'emphasis': style.italic = true; break; + case 'sup': + style.sup = true; + break; + case 'sub': + style.sub = true; + break; case 'center': style.center = true; break; @@ -580,6 +586,12 @@ export default class BookParser { case 'emphasis': style.italic = false; break; + case 'sup': + style.sup = false; + break; + case 'sub': + style.sub = false; + break; case 'center': style.center = false; break;