polytexnic 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/polytexnic/postprocessors/html.rb +11 -4
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_html/text_formatting_spec.rb +2 -2
- 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: a8a0c351f7c8251034a4f2ca7f297f1f225457290ebfb2ef38911a875d9a42c4
|
4
|
+
data.tar.gz: 85d99ee23219338e4bebef369b1d350b802129519f335281199d0428460fb596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5005d68edad891179a10c808dbbe972418abf671edf38cffe948c6ec10be3f6fe85997d67f15496ebe56cc99bfad879b01623686e1b682440a79e9069880ef
|
7
|
+
data.tar.gz: 8f6ec11f1ea93e346b4dcab20ace4b908e1547c28227db8c262a7ef9758a9cf4dcfd451b7ce864a0d704a6355dca685ba3785e9a54f155a2b9e4302b0112eea0
|
@@ -36,8 +36,8 @@ module Polytexnic
|
|
36
36
|
spaces(doc)
|
37
37
|
center(doc)
|
38
38
|
title(doc)
|
39
|
-
doc = smart_single_quotes(doc)
|
40
39
|
kode(doc)
|
40
|
+
doc = smart_single_quotes(doc)
|
41
41
|
tex_logos(doc)
|
42
42
|
restore_literal(doc)
|
43
43
|
doc = restore_unicode(doc)
|
@@ -692,9 +692,10 @@ module Polytexnic
|
|
692
692
|
def kode(doc)
|
693
693
|
doc.xpath('//kode').each do |node|
|
694
694
|
node.name = 'code'
|
695
|
-
#
|
696
|
-
|
697
|
-
|
695
|
+
# Prevent gsubbing of single quotes.
|
696
|
+
key = digest(node.content)
|
697
|
+
literal_cache[key] = node.content
|
698
|
+
node.content = key
|
698
699
|
end
|
699
700
|
end
|
700
701
|
|
@@ -871,6 +872,12 @@ module Polytexnic
|
|
871
872
|
node.name = 'span'
|
872
873
|
node['class'] = 'unicode'
|
873
874
|
end
|
875
|
+
# Restore code
|
876
|
+
doc.css('code').each do |node|
|
877
|
+
if literal_cache[node.content]
|
878
|
+
node.content = literal_cache[node.content]
|
879
|
+
end
|
880
|
+
end
|
874
881
|
end
|
875
882
|
|
876
883
|
def restore_unicode(doc)
|
data/lib/polytexnic/version.rb
CHANGED
@@ -60,8 +60,8 @@ describe 'Polytexnic::Pipeline#to_html' do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
context "with quotes" do
|
63
|
-
let(:polytex) { %(\\kode{'a'.."z"}) }
|
64
|
-
it { should include %(<code>'a'.."z"</code>) }
|
63
|
+
let(:polytex) { %(\\kode{'a'.."z" == "don’t"}) }
|
64
|
+
it { should include %(<code>'a'.."z" == "don’t"</code>) }
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|