asciidoctor-latexmath 1.0.0.beta.2 → 1.0.0.pre.dev.1

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: cbd7c58fc991a8905b27b73ff5de3cffd102acef4362cc816ef3efdac87cddf9
4
- data.tar.gz: e014bba6c3f364fadda330af88d8c18bb80bd090261ab4130676e484a30e18cc
3
+ metadata.gz: 76676b29d9c14de950508c4620ede617e51f5cc874ad9c16aa8ac9fe98726304
4
+ data.tar.gz: c361670b70f0db1ea1f1756698af831b94bd257186080bae157cfce6607b6e7e
5
5
  SHA512:
6
- metadata.gz: 71df15fbadccafd57d77f0488da9d8c2b5ed9b2504394c2a36d73979b30c7edac3be8e13c7cc3535e928dd2900d59cddd8b429fcff4ddd5ff106c3f45a5ebf41
7
- data.tar.gz: 7fb1d2e784ae30690e0909bc5c51ee011d401acda4f36f6fa82cbfe8233c24956156b73f85e59f23ffbabdfd85654aa134f288ea40ec16b55e1e951572808d87
6
+ metadata.gz: 70205787e5d7cf969ff5015afa71130f1e90b187da5103a0a6ca2c468edb6555e9fd539eb60b4fce7e5185880b79b0804fc152ae3b4e1b3a0998bb97957b52ea
7
+ data.tar.gz: 7f618f19aa454abf8c60790b0d0d666efbd902bf2757ca3e66617f745ee8b275ed7323630e1ba757ae726fd305cee2ff26496b267111e7d7e9b4da07691d3be8
@@ -11,7 +11,6 @@ require "shellwords"
11
11
  require "digest"
12
12
  require "pathname"
13
13
  require "json"
14
- require "cgi"
15
14
  require "asciidoctor"
16
15
 
17
16
  module Asciidoctor
@@ -57,16 +56,15 @@ module Asciidoctor
57
56
  end
58
57
 
59
58
  def render(equation:, display:, inline: false, id: nil, asciidoc_source: nil, source_location: nil)
60
- normalized_equation = normalize_equation(equation)
61
- basename = sanitize_basename(id) || auto_basename(normalized_equation)
59
+ basename = sanitize_basename(id) || auto_basename(equation)
62
60
  inline_embed = inline && @inline_attribute
63
61
  signature = cache_signature(
64
- equation: normalized_equation,
62
+ equation: equation,
65
63
  display: display,
66
64
  inline: inline,
67
65
  inline_embed: inline_embed
68
66
  )
69
- equation_digest = Digest::SHA256.hexdigest(normalized_equation)
67
+ equation_digest = Digest::SHA256.hexdigest(equation)
70
68
 
71
69
  if @cache_enabled
72
70
  if (cached = load_cached_render(basename, signature, equation_digest, inline_embed))
@@ -80,7 +78,7 @@ module Asciidoctor
80
78
  tex_path = File.join(dir, "#{basename}.tex")
81
79
  pdf_path = File.join(dir, "#{basename}.pdf")
82
80
 
83
- latex_source = build_document(normalized_equation, display)
81
+ latex_source = build_document(equation, display)
84
82
  File.write(tex_path, latex_source)
85
83
  begin
86
84
  run_pdflatex(
@@ -512,15 +510,6 @@ module Asciidoctor
512
510
  def latex_environment?(equation)
513
511
  equation.match?(/\\begin\s*\{[^}]+\}/) && equation.match?(/\\end\s*\{[^}]+\}/)
514
512
  end
515
-
516
- def normalize_equation(equation)
517
- return "" if equation.nil?
518
-
519
- stripped = equation.to_s.strip
520
- return "" if stripped.empty?
521
-
522
- CGI.unescapeHTML(stripped).tr("\u00A0", " ")
523
- end
524
513
  end
525
514
  end
526
515
  end
@@ -6,6 +6,6 @@
6
6
 
7
7
  module Asciidoctor
8
8
  module Latexmath
9
- VERSION = "1.0.0.beta.2"
9
+ VERSION = "1.0.0-dev.1"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-latexmath
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.2
4
+ version: 1.0.0.pre.dev.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shuai Zhang