1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-27 02:05:34 +02:00

finally fixed the sub/sup thing

This commit is contained in:
Pomax
2018-11-16 14:33:29 -08:00
parent 92f290f3cf
commit 9eb0692e1c
10 changed files with 21 additions and 11 deletions

View File

@@ -79,6 +79,9 @@ function processLocation(loc, section, number) {
.replace(/'/g, "'")
.replace(/"/g, '"')
// compensate for <sub> and <sup> getting safified:
d = d.replace(/&lt;(\/?)su([bp])&gt;/g, "<$1su$2>");
// ``` conversion does odd things with <code> tags inside <pre> tags.
d = d.replace(/<pre>(\r?\n)*<code>/g,'<pre>')
.replace(/<\/code>(\r?\n)*<\/pre>/g,'</pre>');
@@ -174,7 +177,12 @@ function writeContentBundle(locale, content) {
// Write the actual locale directory and generate a locale-specific index.html
var html = fs.readFileSync('./index.template.html').toString();
var preface = content.preface.getContent.replace(/<SectionHeader name="preface" title="([^"]+)"\/>/, "<h2>$1</h2>");
var preface = "";
if (content.preface) {
preface = content.preface.getContent.replace(/<SectionHeader name="preface" title="([^"]+)"\/>/, "<h2>$1</h2>");
}
html = html.replace("<!doctype html>", "<!-- AUTOGENERATED CONTENT, PLEASE EDIT 'index.template.html' INSTEAD! -->\n<!doctype html>");
html = html.replace("{{ PREFACE }}", preface);
html = html.replace("{{ locale }}", locale);