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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 423d284da13a7492acee7fac2e273dbe9d25663362e97a54ae4ff5daa297a171
4
- data.tar.gz: f52db09a79e8a3e0805b0094ebe95e47571b252b34ecb0de1d3c80b0275a94a6
3
+ metadata.gz: a8a0c351f7c8251034a4f2ca7f297f1f225457290ebfb2ef38911a875d9a42c4
4
+ data.tar.gz: 85d99ee23219338e4bebef369b1d350b802129519f335281199d0428460fb596
5
5
  SHA512:
6
- metadata.gz: c965d97832722277b12405d12404b258c8d19a960b3732496114ba6748ccf2b890a67ec212bf9aa9cb984a70716af47324aa68933285bfad0384cac271d676a3
7
- data.tar.gz: ba2aa4bebfb0d68ba0971b16c42528569fe30539aee9bb151acae7a02d87240c6a54d6eef40477ff61bab2657ed3dccad56cc40c09af0f49fabe952a68dede1d
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
- # Undo "smart" quotes in kode.
696
- node.content = node.content.gsub("‘", "'")
697
- node.content = node.content.gsub("’", "'")
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)
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.5.7"
2
+ VERSION = "1.5.8"
3
3
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polytexnic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl