summaryrefslogtreecommitdiffhomepage
path: root/gleam
diff options
context:
space:
mode:
Diffstat (limited to 'gleam')
-rw-r--r--gleam/flake.lock8
-rw-r--r--gleam/src/write/epub.gleam2
-rw-r--r--gleam/src/write/rgx.gleam2
-rw-r--r--gleam/src/write/text.gleam8
4 files changed, 11 insertions, 9 deletions
diff --git a/gleam/flake.lock b/gleam/flake.lock
index ab89304..f2eda10 100644
--- a/gleam/flake.lock
+++ b/gleam/flake.lock
@@ -19,11 +19,11 @@
"ocda-lib": {
"flake": false,
"locked": {
- "lastModified": 1790430427,
- "narHash": "sha256-GSfZ1mJstp+rpvCvQJzPlXLPlrziV6uDa3Tvs/9b9p0=",
+ "lastModified": 1790705252,
+ "narHash": "sha256-lMPJxbVyAiMr8/yKvuRLeJgT+aGEQv0MiW9hlQLa/os=",
"ref": "refs/heads/main",
- "rev": "fda48e417435e31a3122bfa7ca563333628aed99",
- "revCount": 1,
+ "rev": "8b8a8c1b61c740528e1409a2429f7ec4403f9576",
+ "revCount": 2,
"type": "git",
"url": "git://git.sisudoc.org/tools/sisudoc-ocda-lib"
},
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.