Lutaml integration#123
Open
andrew2net wants to merge 15 commits into
Open
Conversation
…for 2.1.0 release
* Preserve XML-fragment markup in Bibcollection title/author Port of fd20c9d (#125) to the v2/lutaml-integration branch. Switch Bibcollection.from_xml to read the collection title and author via inner_html instead of Nokogiri's .text, so the in-memory strings keep their XML-fragment form (markup + entities intact). Apply the strip_html Liquid filter on the HTML <title> tag position so the browser tab title stays plain text. Adds find_html to ElementFinder alongside find_text. Adds a regression spec with markup and & in both the collection title and the author name. Refs metanorma/isodoc#785.
Port the write-path fix from #128 to v2/lutaml-integration. The read-path half of #128 (find_html + strip_html) was already ported via #127; this commit ports the remaining to_xml escaping. bibcollection.rb to_xml was writing the collection title and author directly into XML without escaping, producing bare & in the output when the values came from YAML (e.g. name: "A test & playground ..."). A bare & is invalid XML; libxml2 in recovery mode emits FATAL "xmlParseEntityRef: no name" and then silently drops all subsequent & entities in the same document — corrupting every individual document title's & in the collection index HTML output. Add a private xml_escape helper that escapes only unencoded & (not already-encoded &, &#nnn;, &#xhh;) and leaves inline markup tags (<em>, <strong>, etc.) untouched, so valid HTML fragments round-tripped via find_html pass through unchanged. Fixes metanorma/isodoc#785: metanorma/isodoc#785 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.