summaryrefslogtreecommitdiffhomepage
path: root/gleam/src
diff options
context:
space:
mode:
Diffstat (limited to 'gleam/src')
-rw-r--r--gleam/src/write/epub.gleam2
-rw-r--r--gleam/src/write/rgx.gleam2
-rw-r--r--gleam/src/write/text.gleam8
3 files changed, 7 insertions, 5 deletions
diff --git a/gleam/src/write/epub.gleam b/gleam/src/write/epub.gleam
index 77f4f42..e035393 100644
--- a/gleam/src/write/epub.gleam
+++ b/gleam/src/write/epub.gleam
@@ -252,7 +252,7 @@ fn inline_anchor() -> regexp.Regexp {
fn note_mark() -> regexp.Regexp {
let assert Ok(r) =
regexp.compile(
- "【(\\d+|(?:[*]|[+])+)\\s",
+ "【(\\d+|[*+]+[0-9]*)\\s",
regexp.Options(case_insensitive: False, multi_line: True),
)
r
diff --git a/gleam/src/write/rgx.gleam b/gleam/src/write/rgx.gleam
index 71add21..1bc525f 100644
--- a/gleam/src/write/rgx.gleam
+++ b/gleam/src/write/rgx.gleam
@@ -174,7 +174,7 @@ fn apply(
/// A note's mark may be a number or a run of stars or pluses, and both are
/// gathered into the endnotes section, so both need a reference.
pub fn inline_notes_any_mark() -> Regexp {
- re("【(\\d+|(?:[*]|[+])+)\\s+(.+?)\\s*】")
+ re("【(\\d+|[*+]+[0-9]*)\\s+(.+?)\\s*】")
}
/// A link before its url has been substituted in: the number is an index into
diff --git a/gleam/src/write/text.gleam b/gleam/src/write/text.gleam
index 2e44e3a..77897d5 100644
--- a/gleam/src/write/text.gleam
+++ b/gleam/src/write/text.gleam
@@ -80,9 +80,11 @@ fn toc_depths(doc: Document) -> Dict(Int, Int) {
/// and an output that loses it silently cannot be checked.
fn object(obj: Object, depths: Dict(Int, Int)) -> String {
// an object with no text of its own writes nothing. A poem is such an
- // object: it is a container that closes a run of verses and carries the
- // *same* object number as the last of them, so writing it would put that
- // number in the file twice - 15 times over in one sample.
+ // object: a container of the verses that follow it, which are what is
+ // written. Since format 2.1 it carries object number 0 and states the
+ // range of its verses; before, it closed the run carrying the *same*
+ // number as the last verse, and writing it put that number in the file
+ // twice - 15 times over in one sample. Both forms write nothing.
// and a dummy heading writes nothing: it is generated furniture whose text
// repeats the heading above it, and every other writer here drops it.
// Spine's text keeps it, so a trailing section's name is in the file twice.