slaw 10.5.0 → 10.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/slaw/extract/html_to_akn_text.xsl +29 -23
- data/lib/slaw/grammars/za/act_text.xsl +1 -1
- data/lib/slaw/version.rb +1 -1
- 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: 2feb9ea5e726f4300a0920de90b88f14b3a86ce4ae3dddd9a59b3bf8c855e575
|
4
|
+
data.tar.gz: 263ef515bc1a81b8cccc1788a3b107b573f3840492913cedf17ae729745d1c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573bab26b9e880856e74404058208e9fae5f400f0ee64413d771fea872e4b3b7c626ebefb5c020321dc4b4f35919b25b94801c6622e82d2f2a8dfe3507c35f61
|
7
|
+
data.tar.gz: 01d73bb0903dbee8213eae364316835361b4d34bbe0ed4a12f9dcaeb114bf1e5ec9ac46133e0570bea1998af0daaac610591da905463d64e63f1449ffd529db7
|
data/README.md
CHANGED
@@ -86,6 +86,10 @@ You can create your own grammar by creating a gem that provides these files and
|
|
86
86
|
|
87
87
|
## Changelog
|
88
88
|
|
89
|
+
### 10.6.0 (10 May 2021)
|
90
|
+
|
91
|
+
* Handle sup and sub when extracting from HTML.
|
92
|
+
|
89
93
|
### 10.5.0 (20 April 2021)
|
90
94
|
|
91
95
|
* Handle escaping inlines when unparsing.
|
@@ -11,9 +11,10 @@
|
|
11
11
|
|
12
12
|
<xsl:template match="head|style|script|link" />
|
13
13
|
|
14
|
-
|
14
|
+
<!-- block containers that end with newlines -->
|
15
|
+
<xsl:template match="ul|ol|section|article|h1|h2|h3|h4|h5">
|
15
16
|
<xsl:apply-templates />
|
16
|
-
<xsl:text> </xsl:text>
|
17
|
+
<xsl:text> </xsl:text>
|
17
18
|
</xsl:template>
|
18
19
|
|
19
20
|
<xsl:template match="ul/li">
|
@@ -23,20 +24,23 @@
|
|
23
24
|
<xsl:text> </xsl:text>
|
24
25
|
</xsl:template>
|
25
26
|
|
27
|
+
<!-- numbered lists should include a number -->
|
26
28
|
<xsl:template match="ol/li">
|
27
|
-
<!-- 1. foo -->
|
29
|
+
<!-- \1. foo -->
|
28
30
|
<xsl:text>\</xsl:text>
|
29
|
-
<xsl:
|
31
|
+
<xsl:choose>
|
32
|
+
<xsl:when test="@value">
|
33
|
+
<xsl:value-of select="@value" />
|
34
|
+
</xsl:when>
|
35
|
+
<xsl:otherwise>
|
36
|
+
<xsl:value-of select="position()" />
|
37
|
+
</xsl:otherwise>
|
38
|
+
</xsl:choose>
|
30
39
|
<xsl:text>. </xsl:text>
|
31
40
|
<xsl:apply-templates />
|
32
41
|
<xsl:text> </xsl:text>
|
33
42
|
</xsl:template>
|
34
43
|
|
35
|
-
<xsl:template match="h1|h2|h3|h4|h5">
|
36
|
-
<xsl:apply-templates />
|
37
|
-
<xsl:text> </xsl:text>
|
38
|
-
</xsl:template>
|
39
|
-
|
40
44
|
<xsl:template match="p|div">
|
41
45
|
<xsl:choose>
|
42
46
|
<xsl:when test="starts-with(., '[') and substring(., string-length(.)) = ']'">
|
@@ -51,32 +55,27 @@
|
|
51
55
|
<xsl:text> </xsl:text>
|
52
56
|
</xsl:template>
|
53
57
|
|
58
|
+
<!-- START tables -->
|
59
|
+
|
54
60
|
<xsl:template match="table">
|
55
61
|
<xsl:text>{| </xsl:text>
|
56
|
-
<xsl:text>
|
57
|
-
|-</xsl:text>
|
62
|
+
<xsl:text> |-</xsl:text>
|
58
63
|
<xsl:apply-templates />
|
59
|
-
<xsl:text>
|
60
|
-
|}
|
61
|
-
|
62
|
-
</xsl:text>
|
64
|
+
<xsl:text> |} </xsl:text>
|
63
65
|
</xsl:template>
|
64
66
|
|
65
67
|
<xsl:template match="tr">
|
66
68
|
<xsl:apply-templates />
|
67
|
-
<xsl:text>
|
68
|
-
|-</xsl:text>
|
69
|
+
<xsl:text> |-</xsl:text>
|
69
70
|
</xsl:template>
|
70
71
|
|
71
72
|
<xsl:template match="th|td">
|
72
73
|
<xsl:choose>
|
73
74
|
<xsl:when test="local-name(.) = 'th'">
|
74
|
-
<xsl:text>
|
75
|
-
! </xsl:text>
|
75
|
+
<xsl:text> ! </xsl:text>
|
76
76
|
</xsl:when>
|
77
77
|
<xsl:when test="local-name(.) = 'td'">
|
78
|
-
<xsl:text>
|
79
|
-
| </xsl:text>
|
78
|
+
<xsl:text> | </xsl:text>
|
80
79
|
</xsl:when>
|
81
80
|
</xsl:choose>
|
82
81
|
|
@@ -118,8 +117,15 @@
|
|
118
117
|
</xsl:template>
|
119
118
|
|
120
119
|
<xsl:template match="br">
|
121
|
-
<xsl:text>
|
122
|
-
</xsl:
|
120
|
+
<xsl:text> </xsl:text>
|
121
|
+
</xsl:template>
|
122
|
+
|
123
|
+
<xsl:template match="sup">
|
124
|
+
<xsl:text>^^</xsl:text><xsl:apply-templates /><xsl:text>^^</xsl:text>
|
125
|
+
</xsl:template>
|
126
|
+
|
127
|
+
<xsl:template match="sub">
|
128
|
+
<xsl:text>_^</xsl:text><xsl:apply-templates /><xsl:text>^_</xsl:text>
|
123
129
|
</xsl:template>
|
124
130
|
|
125
131
|
|
data/lib/slaw/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slaw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.
|
4
|
+
version: 10.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Kempe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|