fossbook 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/mod/marked.js CHANGED
@@ -39,6 +39,19 @@ function renderWikipediaCitation(href) {
39
39
  return `<a href="${escapeAttribute(href)}">${escapeAttribute(citation)}</a>`;
40
40
  }
41
41
 
42
+ function renderKoreanBlockquoteQuotes(html) {
43
+ const quoteCount = (html.match(/&quot;/g) || []).length;
44
+ if (quoteCount === 0 || quoteCount % 2 !== 0) return html;
45
+
46
+ let opening = true;
47
+ return html.replace(/&quot;/g, () => {
48
+ const quote = opening ? "“" : "”";
49
+ const position = opening ? "open" : "close";
50
+ opening = !opening;
51
+ return `<span class="dialogue-quote dialogue-quote-${position}">${quote}</span>`;
52
+ });
53
+ }
54
+
42
55
  function matchFencedContainer(source, name) {
43
56
  const opening = new RegExp(`^(:{3,})${name}(?=[ \\t]|\\n)([^\\n]*)\\n`).exec(source);
44
57
  if (!opening) return undefined;
@@ -379,7 +392,10 @@ const renderer = {
379
392
  }
380
393
  },
381
394
  blockquote(quote) {
382
- return `<div class="blockquote-container"><blockquote>${quote}</blockquote></div>`;
395
+ const content = this.options.language === "ko"
396
+ ? renderKoreanBlockquoteQuotes(quote)
397
+ : quote;
398
+ return `<div class="blockquote-container"><blockquote>${content}</blockquote></div>`;
383
399
  },
384
400
  paragraph(text) {
385
401
  // remove <p> surrounding the image
package/lib/mod/page.js CHANGED
@@ -50,7 +50,7 @@ module.exports = class Page extends PageBase {
50
50
  }
51
51
 
52
52
  // generated HTML from markdown
53
- this.body = marked.parse(content.body);
53
+ this.body = marked.parse(content.body, { language: this.config.language });
54
54
  // remove <p></p> and <p> </p> from the beginning and end of the content.body
55
55
  this.body = this.body.replace(/<p><\/p>/g, "").replace(/<p> <\/p>/g, "");
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fossbook",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "A lightweight static blog site generator for GitHub Pages",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -147,6 +147,10 @@
147
147
  line-height: inherit;
148
148
  }
149
149
 
150
+ html:lang(ko) .dialogue-quote {
151
+ font-family: 'NanumSquareNeo', sans-serif;
152
+ }
153
+
150
154
  @media print {
151
155
  .transcript-control {
152
156
  display: none;
@@ -175,6 +179,10 @@
175
179
  ol > li::marker {
176
180
  font-family: 'Roboto Mono', monospace;
177
181
  }
182
+ html:lang(ko) ol > li::marker {
183
+ font-family: sans-serif;
184
+ font-variant-numeric: tabular-nums;
185
+ }
178
186
 
179
187
  /*
180
188
  ul.pagination {