hematite 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57c0b3ae9bdec4a2e37d649a52dfbacb84a8c09b258d2a5bb676571c5fed060d
4
- data.tar.gz: '09bc9aa4956973f5cbb3dfa1e4889b9adfe70928eb5f2f25518b09b863a4e8ed'
3
+ metadata.gz: d695f60bf686920b70204b57a6938283468f63be8ba35467bff6db792fbed6af
4
+ data.tar.gz: d5b505891fb8bb9be670d61454b8c80e5c0ac7463d22fbeba4244ceea9692a78
5
5
  SHA512:
6
- metadata.gz: 86065a34d00cc7d8844bdd02883dc7c8dd25c4c6436a1d4b28747d0140d4409d0ac7e7a910d8fe4f54ba546c303208cb347d598141a6e66b1d0c5607e282f249
7
- data.tar.gz: 2b218f88fec888c6029650fdd29b0809729cd321905e25e9151e26173347e7488813eebcc79d32c7ced657d8a4ce7a0e2acb4b9386e9d683607b6622e6911784
6
+ metadata.gz: 1f67a7e799a1a0bf26222a9fb9891e8265bf70d1f2e5210cdc85d0e293499c6da68ed589c401ab754ff30588d81eb8a3923a104b2343569539f01d95f0f80d39
7
+ data.tar.gz: e8c5c1dcde0d2f9087a251658e5a7e5eb15dd97f2a8ac31bdeb2147fad6fac8f609d42a96d85bb36964c6f43511baa0cc5202cdd3335a11dadb8fb2729d5e398
@@ -3,9 +3,13 @@ layout: default
3
3
  ---
4
4
 
5
5
  <!-- Defines a https://remarkjs.com/ slideshow -->
6
- <!-- Configure remark with
6
+ <!--
7
+ Configure remark with
7
8
  page.remark_presentation_config, site.remark_presentation_config,
8
9
  page.remark_presentation_config_html
10
+
11
+ Note: Jekyll's default parser must not parse the input markdown file.
12
+ Either use a non-md extension or wrap its content in a <div markdown=false>...</div>
9
13
  -->
10
14
 
11
15
  {% assign frame_resource_url = 'assets/html/remark_presentation_frame.html.resource' | relative_url %}
@@ -16,7 +20,20 @@ layout: default
16
20
  onload="window.presentationFrameLoaded = true;"></iframe>
17
21
  </main>
18
22
 
23
+ <!--
24
+ Liquid (sometimes?) does not handle unicode (e.g. π) characters properly when using
25
+ url_encode (or at least not consistently with JS's unescape), so include
26
+ content directly:
27
+ -->
28
+ <textarea id="source" style="display: none;">
29
+ {{content}}
30
+ </textarea>
31
+
19
32
  <script defer type="module">
33
+ // Matches <div>...</div> or <div markdown=0>...</div>
34
+ // Jekyll can remove the 'markdown=0' while parsing.
35
+ const WRAPPING_DIV_EXP = /\s*[<]div.*[>]((?:.|[\n\r])*)[<]\/div[>]\s*/;
36
+
20
37
  import slideshow from "{{ 'assets/js/layout/remark_slideshow.mjs' | relative_url }}";
21
38
 
22
39
  let presentationFrame = document.querySelector("#presentation_frame");
@@ -27,7 +44,17 @@ layout: default
27
44
  {{ page.remark_presentation_config | default: site.remark_presentation_config | jsonify }};
28
45
  config ??= {};
29
46
 
30
- config.source = {{ page.content | jsonify }};
47
+ // Escape the content to prevent liquid from rendering it.
48
+ config.source = document.querySelector("#source").value;
49
+
50
+ // Unwrap if surrounded by markdown-parser-disabling HTML
51
+ let markdownDisableMatches = config.source.match(WRAPPING_DIV_EXP);
52
+ console.log(markdownDisableMatches, config.source);
53
+
54
+ // Replace with first capture (contents of the wrapping element).
55
+ if (markdownDisableMatches && markdownDisableMatches.length > 0) {
56
+ config.source = markdownDisableMatches[1];
57
+ }
31
58
 
32
59
  // Library imports intended for this page: Forward to the frame.
33
60
  let libraryImports = unescape(`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hematite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Heino