jektex 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jektex/jektex.rb +4 -4
- data/lib/jektex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f411d475735a808e6fb495464688d7acca5fb2afa3d4f467612fc7d5308b7a
|
4
|
+
data.tar.gz: e322f027b1c7080553a9cf3e3d4145b49166f6d26e3c5502b3daf8a0ce61a0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30af1bad450e61c9085975a37b6a2142084854d96201eb67e11cc9c80a21d9d3dbbc5894c82610f2cac7ab52b8272f3f5aae8b74bfa054480edbea9865ebbc48
|
7
|
+
data.tar.gz: 06c8353988adc7940217d6a75ca313cf72a65492db30ab5421567c822199dd6c4b57c86a28485a0b146de826b69c6c1ee80ccb00335277f0b23065881670949d
|
data/lib/jektex/jektex.rb
CHANGED
@@ -62,13 +62,13 @@ end
|
|
62
62
|
|
63
63
|
def escape_method( type, expression, doc_path )
|
64
64
|
# detect if expression is in display mode
|
65
|
-
is_in_display_mode
|
65
|
+
is_in_display_mode = type.downcase =~ /\[/
|
66
66
|
|
67
67
|
# generate a hash from the math expression
|
68
|
-
expression_hash = Digest::SHA2.hexdigest(
|
68
|
+
expression_hash = Digest::SHA2.hexdigest(expression) + is_in_display_mode.to_s
|
69
69
|
|
70
70
|
# use it if it exists
|
71
|
-
if($cache.has_key?(expression_hash) && !contains_updated_global_macro?(
|
71
|
+
if($cache.has_key?(expression_hash) && !contains_updated_global_macro?(expression))
|
72
72
|
# check if expressin conains updated macro
|
73
73
|
$count_newly_generated_expressions += 1
|
74
74
|
print_stats
|
@@ -80,7 +80,7 @@ def escape_method( type, expression, doc_path )
|
|
80
80
|
begin
|
81
81
|
# render using ExecJS
|
82
82
|
result = KATEX.call("katex.renderToString", expression,
|
83
|
-
{
|
83
|
+
{ displayMode: is_in_display_mode, macros: $global_macros})
|
84
84
|
rescue SystemExit, Interrupt
|
85
85
|
# save cache to disk
|
86
86
|
File.open($path_to_cache, "w"){|to_file| Marshal.dump($cache, to_file)}
|
data/lib/jektex/version.rb
CHANGED