summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-04-19 01:02:32 -0600
committerDan Allen <dan.j.allen@gmail.com>2018-04-23 23:30:21 -0600
commit8a5bd8d36b12a0816ce509c275c9249d27e3b1cb (patch)
treec24c655ddd926ba63b5f3b02ecef2029dc60e34a /features
parent606d2efdae70169565bf9a27ebf99e463339523e (diff)
resolves #2381 parse text of xref macro as attributes if attribute signature detected
- if attribute signature is detected in text of xref macro, parse text as attributes - if role is set on xref, add it to class attribute of <a> element in HTML5 converter - rename append_anchor_constraint_attrs to append_link_constraint_attrs - add link contraint attributes to <a> element of interdoc xref
Diffstat (limited to 'features')
-rw-r--r--features/xref.feature126
1 files changed, 126 insertions, 0 deletions
diff --git a/features/xref.feature b/features/xref.feature
index bd4215a6..260fbde5 100644
--- a/features/xref.feature
+++ b/features/xref.feature
@@ -846,3 +846,129 @@ Feature: Cross References
|refer to
a< href='#Section One' [Section One]
"""
+
+ Scenario: Parses text of xref macro as attributes if attribute signature found
+ Given the AsciiDoc source
+ """
+ == Section One
+
+ content
+
+ == Section Two
+
+ refer to xref:_section_one[role=next]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_section_one
+ |Section One
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_section_two Section Two
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_section_one' class='next' Section One
+ """
+
+ Scenario: Does not parse text of xref macro as attribute if attribute signature not found
+ Given the AsciiDoc source
+ """
+ == Section One
+
+ content
+
+ == Section Two
+
+ refer to xref:_section_one[One, Section One]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_section_one
+ |Section One
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_section_two Section Two
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_section_one' One, Section One
+ """
+
+ Scenario: Uses whole text of xref macro as link text if attribute signature found and text is enclosed in double quotes
+ Given the AsciiDoc source
+ """
+ == Section One
+
+ content
+
+ == Section Two
+
+ refer to xref:_section_one["Section One == Starting Point"]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_section_one
+ |Section One
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_section_two Section Two
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_section_one'
+ |Section One == Starting Point
+ """
+
+ Scenario: Does not parse text of xref macro as text if enclosed in double quotes but attribute signature not found
+ Given the AsciiDoc source
+ """
+ == Section One
+
+ content
+
+ == Section Two
+
+ refer to xref:_section_one["The Premier Section"]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_section_one
+ |Section One
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_section_two Section Two
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_section_one' "The Premier Section"
+ """
+
+ Scenario: Can escape double quotes in text of xref macro using backslashes when text is parsed as attributes
+ Given the AsciiDoc source
+ """
+ == Section One
+
+ content
+
+ == Section Two
+
+ refer to xref:_section_one["\"The Premier Section\"",role=spotlight]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_section_one
+ |Section One
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_section_two Section Two
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_section_one' class='spotlight' "The Premier Section"
+ """