coradoc-html 1.1.19 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 011622bc6889a0af8aadea9d1a13e4cd4e322b808f5afe95b5da4a785a4b720f
4
- data.tar.gz: ffe601423e5ab805e854e150744983336c49d217858a9f4d5aa660ced64d9f9b
3
+ metadata.gz: 7b80c7ecc059a1f17523119dae3e89844ba8dd3fd1b3c81a75b285b71ae7a025
4
+ data.tar.gz: 74c971f574f006af62d33ad0a7b7e6efea25ed133d0b8fe43ff8596f66adb844
5
5
  SHA512:
6
- metadata.gz: 0225afbdd3e517cb260bad9edc7a469605918937faebcc5a425b202e61ac36a6e66d96304defbca5562aa49421fdb20d436c0d47241ab272a0c19344ae839940
7
- data.tar.gz: c2847f907efb900fb4ccef551254e808cc042c7aa5d8af2c0439a493fa560b58e07ed55d643a9c915d4cd6f765b1c7d6cff498e6408fee1e8f242b4833b40ff5
6
+ metadata.gz: 28fb0309d4a60f6023299020928ca3fa91b0cb8b760f8ea60910423521331e6d8f7fe4edfe5621513f4bd9070e7f66bc0450948e3b8638fe717cad6118293a66
7
+ data.tar.gz: 27ec60dbeab0d9bf586e51919d8de05ff560cfb5abc3e210e04c392f2640ca17873f64ff2fc68f6abb3b74a1d3ece0531966b6b1a700fea452ce7eb378bf08a8
@@ -96,7 +96,7 @@ module Coradoc
96
96
  else
97
97
  raise Errors::InvalidConfigurationError,
98
98
  "unknown value #{Html.input_config.unknown_tags.inspect} " \
99
- 'for Coradoc::Html.input_config.unknown_tags'
99
+ 'for Coradoc::Html.input_config.unknown_tags'
100
100
  end
101
101
  end
102
102
  end
@@ -8,6 +8,17 @@ module Coradoc
8
8
  Escape.escape_html(stripped_term)
9
9
  end
10
10
 
11
+ # All terms on this `<dt>`, escaped and id-stripped. Multi-term
12
+ # `<dt>`'s (AsciiDoc `term1::\nterm2::`) carry multiple entries;
13
+ # templates iterate this collection to emit one `<dt>` per term.
14
+ # Falls back to `[term]` for legacy callers that only set the
15
+ # singular `term` accessor.
16
+ def terms
17
+ raw = @model.terms
18
+ collection = raw.nil? || raw.empty? ? [@model.term.to_s] : raw.map(&:to_s)
19
+ collection.map { |t| Escape.escape_html(strip_term_id(t)) }
20
+ end
21
+
11
22
  def term_id
12
23
  match = term_text.match(/\A\[\[([^\]]+)\]\]/)
13
24
  match&.[](1)
@@ -36,6 +47,12 @@ module Coradoc
36
47
  def stripped_term
37
48
  term_text.sub(/\A\[\[[^\]]+\]\]/, '')
38
49
  end
50
+
51
+ # Strip a leading `[[id]]` anchor from a term string. Shared by
52
+ # `terms` (per-entry) and `stripped_term` (primary term).
53
+ def strip_term_id(text)
54
+ text.to_s.sub(/\A\[\[[^\]]+\]\]/, '')
55
+ end
39
56
  end
40
57
 
41
58
  DropFactory.register(CoreModel::DefinitionItem, DefinitionItemDrop)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Coradoc
4
4
  module Html
5
- VERSION = '1.1.19'
5
+ VERSION = '1.1.20'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coradoc-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.19
4
+ version: 1.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.