asciidoctor-mathml 0.1.0 → 0.1.2

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: 30d4154c08818f8383a3b1785f9e12f54ba14471ec4cdd4358d8f0660a1149f1
4
- data.tar.gz: 8a2ba6d4b7ff57381614fa4f9dd6484d1779f4009b7917b1114c41f687d8d15c
3
+ metadata.gz: ae2d15ae275271c035fd9e8fe0448378b546393e5f3d639ee8ca17329ec3d83d
4
+ data.tar.gz: 11b559dedb162e41a3c502fd744be754c4328197847e04a3d09b83b836e4a683
5
5
  SHA512:
6
- metadata.gz: 6a1ca7b78faef47dfe8cdec9a5a71478f678edd0314fca674684aa5b3e38c2ef807c0c870cd3ce5a636cb6af2674fa6138fc348316bfd6d105e7785cd60461a1
7
- data.tar.gz: ac9c789f2693df2041b9a136d841727307980a68ff6eef1c1ebf6c7168febdb165740c4743401002e9c7f0e3b6826d645e3704f4e13c3908b49daaa864511246
6
+ metadata.gz: 1801c97dfc7112a54ba6b81f532ed845b723d8897151fc54a73da5880c522d89f878cfa42feb46dbc832b7efbd08604e9b61eae5816471afb1f7b6edd28cc2e3
7
+ data.tar.gz: 971978ff529adb230e9f8b0c72d987482b1236b56f926852056b8089620d8354e229e7c6bca8035901d5c20b2227281fe7209e5df74897a872879e6f820ed154
@@ -5,7 +5,7 @@ module Asciidoctor
5
5
  # Inspired by https://github.com/asciidoctor/asciidoctor-mathematical/blob/6316a270ec6e58a2735f626b089372c5c169aac7/lib/asciidoctor-mathematical/extension.rb
6
6
  class StemTreeProcessor < Asciidoctor::Extensions::TreeProcessor
7
7
  def process(document)
8
- if document.backend=='html5'
8
+ if document.attr('force_mathml_conversion', false) || ['html5', 'multipage_html5'].include?(document.backend)
9
9
  default_stem = ['asciimath', nil].include?(document.attr('stem')) ? 'asciimath' : document.attr('stem')
10
10
 
11
11
  document.find_by(context: :stem, traverse_documents: true).each do |node|
@@ -87,6 +87,14 @@ module Asciidoctor
87
87
 
88
88
  def convert_asciimath_to_mathml(text)
89
89
  AsciiMath.parse(CGI.unescape_html(text)).to_mathml
90
+ rescue StandardError
91
+ warn <<~MESSAGE
92
+ Failed to parse the following Asciimath code:
93
+
94
+ #{text}
95
+ MESSAGE
96
+
97
+ raise
90
98
  end
91
99
  end
92
100
  end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Mathml
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-mathml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - expeehaa
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-05-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: asciidoctor
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
- description:
42
40
  email:
43
41
  - expeehaa@outlook.com
44
42
  executables: []
@@ -56,7 +54,6 @@ metadata:
56
54
  allowed_push_host: https://rubygems.org
57
55
  homepage_uri: https://github.com/expeehaa/asciidoctor-mathml
58
56
  source_code_uri: https://github.com/expeehaa/asciidoctor-mathml
59
- post_install_message:
60
57
  rdoc_options: []
61
58
  require_paths:
62
59
  - lib
@@ -71,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
68
  - !ruby/object:Gem::Version
72
69
  version: '0'
73
70
  requirements: []
74
- rubygems_version: 3.4.10
75
- signing_key:
71
+ rubygems_version: 4.0.10
76
72
  specification_version: 4
77
73
  summary: AsciiDoctor extension to convert STEM to MathML
78
74
  test_files: []