metanorma-standoc 2.0.5.1 → 2.0.5.2

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: cfc9dd3ae0dd167d4c3b92c4b051619cde74ae602a66c9b34e363af1498682a0
4
- data.tar.gz: 1cde7c4c003cdf59c2ef85e0ec1fc3247095716b6fc4f99b121c638f0744aaf9
3
+ metadata.gz: 75c1f0434e53ee6bfe52bd329b1ddc84f08386c39da60ff1a00f6a34914b7709
4
+ data.tar.gz: c7ff940d7544e1d81b4a9ac7e3d0f42bc0398a34b8a5e7036ffe4806a2776615
5
5
  SHA512:
6
- metadata.gz: af0f552acb3f93c8c2e1f1bff1ca60fadff61a5242e08bf0de29df086906a14025a1f6b2d2fb23a6e97afdd086fb60c9b812a91359056e6195a42a6d1d305630
7
- data.tar.gz: cfad71e3de0a31950aee00c477a50449b97eb436ea6261584b73c616d7d24d30ab380ff7504b0357bd5e234752639a7705a43dca46f9f15983114ea50eaf2210
6
+ metadata.gz: 965db9580243b582af5051840e1a258e74963383bdcb377691cbb5aac2fbec083096cd201aca8c677f0a637ab793b3aa762fb02f5aa7767e710469bc39f0a8a0
7
+ data.tar.gz: 894d7350c1438462826073b48a7db77889466aa7d122b991c2c4bb212a12177bab53095a76d9a2e4444a355f6b5343b0f1d7be008c347fdc84f9df52f60924f8
@@ -2,7 +2,7 @@ module Metanorma
2
2
  module Standoc
3
3
  module Cleanup
4
4
  def textcleanup(result)
5
- text = result.flatten.map { |l| l.sub(/\s*$/, "") } * "\n"
5
+ text = result.flatten.map { |l| l.sub(/\s*\Z/, "") } * "\n"
6
6
  !@keepasciimath and text = asciimath2mathml(text)
7
7
  text = text.gsub(/\s+<fn /, "<fn ")
8
8
  text.gsub(%r{<passthrough\s+formats="metanorma">([^<]*)
@@ -32,7 +32,7 @@ module Metanorma
32
32
  end
33
33
 
34
34
  def uninterrupt_quotes_around_xml_skip(elem)
35
- !(/^['"]/.match?(elem.text) &&
35
+ !(/\A['"]/.match?(elem.text) &&
36
36
  elem.previous.ancestors("pre, tt, sourcecode, stem, figure, bibdata")
37
37
  .empty? &&
38
38
  ((elem.previous.text.strip.empty? &&
@@ -42,11 +42,11 @@ module Metanorma
42
42
 
43
43
  def uninterrupt_quotes_around_xml1(elem)
44
44
  prev = elem.at(".//preceding::text()[1]") or return
45
- /\S$/.match?(prev.text) or return
45
+ /\S\Z/.match?(prev.text) or return
46
46
  foll = elem.at(".//following::text()[1]")
47
- m = /^(["'][[:punct:]]*)(\s|$)/
47
+ m = /\A(["'][[:punct:]]*)(\s|\Z)/
48
48
  .match(HTMLEntities.new.decode(foll&.text)) or return
49
- foll.content = foll.text.sub(/^(["'][[:punct:]]*)/, "")
49
+ foll.content = foll.text.sub(/\A(["'][[:punct:]]*)/, "")
50
50
  prev.content = "#{prev.text}#{m[1]}"
51
51
  end
52
52
 
@@ -79,8 +79,8 @@ module Metanorma
79
79
  def dumb2smart_quotes1(curr, prev)
80
80
  /[-'"(<>]|\.\.|\dx/.match?(curr.text) or return
81
81
 
82
- /^["']/.match?(curr.text) && prev.match?(/\S$/) and
83
- curr.content = curr.text.sub(/^"/, "”").sub(/"’"/, "‘")
82
+ /\A["']/.match?(curr.text) && prev.match?(/\S\Z/) and
83
+ curr.content = curr.text.sub(/\A"/, "”").sub(/\A'/, "‘")
84
84
  curr.replace(Metanorma::Utils::smartformat(curr.text))
85
85
  end
86
86
 
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.0.5.1".freeze
22
+ VERSION = "2.0.5.2".freeze
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5.1
4
+ version: 2.0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.