polytexnic 1.5.8 → 1.5.9
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 +10 -0
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_html/text_formatting_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a6e8a8c3d448261249e87d26ab7112dd7e1b62486f73b29e6a86d6ccc25bf5e
|
4
|
+
data.tar.gz: dfda5f1da4f604670aaa732698a6e7ea4aca357e74fd6c8a5740919644fee532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21b6cff9ae8c279d03ec7ae4ec849038583e3074809068165f8b384f938b943effc09bea4c1cd62446337baf34577bf1823eac34557ea2843d6d5f81b5b2555b
|
7
|
+
data.tar.gz: 42f4c66b47b8ec7f35e27c076c6af424886451f3502991c736983af55c87203e75272cebabde43cfab26858d8a8077eb295923af0e2a923a2c676fbdd2038a66
|
@@ -12,6 +12,7 @@ module Polytexnic
|
|
12
12
|
boldface(doc)
|
13
13
|
small_caps(doc)
|
14
14
|
small(doc)
|
15
|
+
superscript(doc)
|
15
16
|
skips(doc)
|
16
17
|
verbatim(doc)
|
17
18
|
rule(doc)
|
@@ -108,6 +109,15 @@ module Polytexnic
|
|
108
109
|
end
|
109
110
|
end
|
110
111
|
|
112
|
+
# Handles \textsuperscript.
|
113
|
+
def superscript(doc)
|
114
|
+
doc.xpath('//hi[@rend="sup"]').each do |node|
|
115
|
+
node.name = 'sup'
|
116
|
+
node['class'] = 'footnote'
|
117
|
+
node.remove_attribute('rend')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
111
121
|
# Handles \bigskip, etc.
|
112
122
|
def skips(doc)
|
113
123
|
doc.xpath('//p[@spacebefore]').each do |node|
|
data/lib/polytexnic/version.rb
CHANGED
@@ -37,6 +37,11 @@ describe 'Polytexnic::Pipeline#to_html' do
|
|
37
37
|
it { should resemble '<small>small text</small>' }
|
38
38
|
end
|
39
39
|
|
40
|
+
describe "superscript text" do
|
41
|
+
let(:polytex) { '\textsuperscript{test}' }
|
42
|
+
it { should resemble '<sup class="footnote">test</sup>' }
|
43
|
+
end
|
44
|
+
|
40
45
|
describe "typewriter text" do
|
41
46
|
let(:polytex) { '\texttt{typewriter text}' }
|
42
47
|
it { should resemble '<code class="tt">typewriter text</code>' }
|
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.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|