2022-10-29 18:47:05 +01:00
|
|
|
local refs
|
|
|
|
|
|
|
|
refs = parse_references_enum('mylabel')
|
|
|
|
assert(#refs == 1)
|
|
|
|
assert(refs[1].anchor == 'mylabel')
|
|
|
|
assert(not refs[1].end_of_range)
|
|
|
|
assert(make_raw_content_tex(refs, 'page', true)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum{{mylabel}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
assert(make_raw_content_tex(refs, 'page', false)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum[noprefix]{{mylabel}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
assert(make_raw_content_tex(refs, 'note', true)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum[note]{{mylabel}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
assert(make_raw_content_tex(refs, 'note', false)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum[note][noprefix]{{mylabel}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
|
|
|
|
refs = parse_references_enum('rangebeg>rangeend')
|
|
|
|
assert(#refs == 1)
|
|
|
|
assert(refs[1].anchor == 'rangebeg')
|
|
|
|
assert(refs[1].end_of_range == 'rangeend')
|
|
|
|
assert(make_raw_content_tex(refs, 'page', true)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum{{rangebeg to rangeend}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
|
|
|
|
refs = parse_references_enum('first, second')
|
|
|
|
assert(#refs == 2)
|
|
|
|
assert(refs[1].anchor == 'first')
|
|
|
|
assert(refs[2].anchor == 'second')
|
|
|
|
assert(make_raw_content_tex(refs, 'page', true)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum{{first}{second}}')
|
2022-10-29 18:47:05 +01:00
|
|
|
|
|
|
|
refs = parse_references_enum('first, rangebeg>rangeend')
|
|
|
|
assert(#refs == 2)
|
|
|
|
assert(refs[1].anchor == 'first')
|
|
|
|
assert(refs[2].anchor == 'rangebeg')
|
|
|
|
assert(refs[2].end_of_range == 'rangeend')
|
|
|
|
assert(make_raw_content_tex(refs, 'page', true)
|
2022-11-06 20:51:12 +00:00
|
|
|
== '\\crossrefenum{{first}{rangebeg to rangeend}}')
|