diff --git a/CHANGELOG.md b/CHANGELOG.md index eeb7f7b..8759a11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [Unreleased] + +- Fixed inline element with attributes is inside a bulleted list not + being processed correctly. + ## v10.1.0 - 2026-01-23 - Added the `inner_text` function. @@ -14,7 +19,6 @@ - Added support for nested lists. - Added support for ordered lists. - Improved support for spans with attributes. - ## v8.0.0 - 2025-11-28 - Added support for inline attributes on links and images. diff --git a/src/jot.gleam b/src/jot.gleam index 5524e73..2bcbc11 100644 --- a/src/jot.gleam +++ b/src/jot.gleam @@ -899,7 +899,7 @@ fn parse_attributes( let in = drop_spaces(in) case in { "" -> None - "}" <> in -> parse_attributes_end(in, attrs) + "}" <> in -> Some(#(attrs, in)) "#" <> in -> { case parse_attributes_id_or_class(in, "") { Some(#(id, in)) -> parse_attributes(in, add_attribute(attrs, "id", id)) @@ -984,18 +984,6 @@ fn parse_attributes_id_or_class( } } -fn parse_attributes_end( - in: String, - attrs: Dict(String, String), -) -> Option(#(Dict(String, String), String)) { - case in { - "" -> Some(#(attrs, "")) - "\n" <> in -> Some(#(attrs, in)) - " " <> in -> parse_attributes_end(in, attrs) - _ -> Some(#(attrs, in)) - } -} - fn parse_block_quote( in: String, refs: Refs, diff --git a/test/cases/links_and_images.test b/test/cases/links_and_images.test index 2b13b37..017592e 100644 --- a/test/cases/links_and_images.test +++ b/test/cases/links_and_images.test @@ -249,3 +249,32 @@ a link or span or image. .

x_y

``` + +Link with attributes in a list (issue #43): +``` +- This is a [link](#){.wibble} +. + +``` + +Link with attributes followed by text: +``` +This is a [link](#){.wibble} more text +. +

This is a link more text

+``` + +Link with attributes followed by text in a list: +``` +- This is a [link](#){.wibble} more text +. + +```