You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: normative-rules.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,8 @@ AsciiDoc supports several styles of anchors:
51
51
Naming restrictions:
52
52
* Start anchor names with a letter and use `:` to separate fields in the anchor name. No spaces allowed in name.
53
53
* Use underscores to separate lists of items between colons (e.g., `:insts:add_sub`) since RISC-V
54
-
uses `-` in some names (e.g., `R-type`).
55
-
* Replace `.` in items with `-` (e.g., `fence.tso` becomes `fence-tso`) so all anchors types used
54
+
uses hyphens in some names (e.g., `R-type`).
55
+
* Replace `.` in items with a hyphen (e.g., `fence.tso` becomes `fence-tso`) so all anchors types used
56
56
work properly (see https://docs.asciidoctor.org/asciidoc/latest/attributes/id/#block-assignment for details).
57
57
58
58
If you'd like to get more detailed AsciiDoc information on anchors, please read:
@@ -89,6 +89,12 @@ If you'd like to see detailed AsciiDoc examples of tagging cases, see https://gi
89
89
>> `Bananas::`<br>
90
90
>> `Typically yellow`<br>
91
91
>> Tagged text: Entire description list
92
+
>
93
+
> Limitations:
94
+
> * Only one paragraph tag per paragraph. Only the last tag is detected so you can't do:
95
+
>>> `[norm:abc]`<br>
96
+
>>> `[xyz]`<br>
97
+
>>> `Here's my paragraph with 2 tags but we only get an anchor for xyz. However since it doesn't start with norm: we won't see any tag for this paragraph.`
92
98
93
99
2. Tagging part of a paragraph, table cells, unordered list items (AKA bullet list), or ordered list items (AKA numbered list)
94
100
@@ -111,10 +117,12 @@ If you'd like to see detailed AsciiDoc examples of tagging cases, see https://gi
111
117
>> Tagged text: `mango` and `apple`<br>
112
118
>
113
119
> Limitations:
114
-
> * Can't anchor text across multiple paragraphs.
120
+
> * Can't anchor text across multiple AsciiDoc blocks (any text separated by blank line) such as paragraphs.
121
+
This also includes text followed by a list (ordered, unordered, description) since there has to be
122
+
a blank line between the text the list.
115
123
> * Must have text next to the 2nd hash symbol (i.e., can't have newline after `[#<anchor-name]#`).
116
124
> * Can't put inside admonitions such as [NOTE] (see #4 below for solution).
117
-
> * Can't have `.` in anchor-name (replace with `-`)
125
+
> * Can't have `.` in anchor-name (replace with hyphen)
118
126
119
127
3. Tagging description lists
120
128
* For description list terms (e.g., `Apples`, `Oranges`), put the anchor immediately after the term on its own line as follows:
Copy file name to clipboardExpand all lines: tests/norm-rule/test.adoc
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,21 @@
8
8
// PASSES
9
9
Before inline [#norm:inline]#inside inline# outside inline.
10
10
11
-
// SHOULD ALWAYS FAIL
12
-
Before bad inline [#norm:bad-inline]#
11
+
// SHOULD ALWAYS FAIL - Can't put inline tag at end of line.
12
+
Before bad inline [#norm:bad-inline-1]#
13
13
inside bad inline# outside bad inline.
14
14
15
+
// SHOULD ALWAYS FAIL - Can't span blocks (paragraphs in this case)
16
+
Before bad inline [#norm:bad-inline-2]#inside bad inline.
17
+
18
+
Next paragraph# outside.
19
+
20
+
// SHOULD ALWAYS FAIL - Can't span blocks (list in this case)
21
+
Before bad inline [#norm:bad-inline-3]#inside bad inline:
22
+
23
+
* Unordered list line 1#
24
+
* Unordered list line 2
25
+
15
26
=== Chapter 1.2 - Paragraph Tagging
16
27
17
28
// PASSES
@@ -31,6 +42,15 @@ Next paragraph 2
31
42
Here's the first line.
32
43
Here's the second line.
33
44
45
+
// FAILS - Can't have multiple paragraph tags (only last works)
46
+
[[norm:abc]]
47
+
[[norm:def]]
48
+
This paragraph has two tags but we only ever get a tag for norm:def.
49
+
50
+
[[norm:abc]]
51
+
[[def]]
52
+
This paragraph has two tags but we'll never see either since the 1st isn't picked up by the tags backend as a tag and the second doesn't start with norm:
53
+
34
54
=== Chapter 2 - Table Tagging
35
55
36
56
// FAILS - Tag includes entire table but has adoc === prefixes/suffixes.
0 commit comments