Skip to content

Bridge bug: ICML filter extracts <Note> content with extractNotes=false (default) #19

Description

@asgeirf

Surfaced by the spec contract audit (PR for spec/icml).

Symptom

Per the bridge composite schema (dist/plugin/formats/okf_icml/schema.json) and the upstream Parameters.reset() in net.sf.okapi.filters.icml.Parameters, the default value of extractNotes is false. With this default, <Note> element content (editorial annotations authored in InCopy / InDesign) should be excluded from the translatable part stream.

The Okapi ICMLFilter instead emits <Note> content as a translatable text unit whenever a Note appears inside a CharacterStyleRange — and, while doing so, splits the surrounding visible text at the Note boundary so the trailing Content run after the Note is dropped from the part stream entirely.

Reproduction

core/formats/icml/spec.yaml feature note_extraction_default::notes_skipped over testdata/notes.icml:

<Story Self=\"story1\" ...>
  <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Body\">
    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/$ID/[No character style]\">
      <Content>Visible text</Content>
      <Note>
        <ParagraphStyleRange ...><CharacterStyleRange ...>
          <Content>Note content here</Content>
        </CharacterStyleRange></ParagraphStyleRange>
      </Note>
      <Content> continues</Content>
    </CharacterStyleRange>
  </ParagraphStyleRange>
</Story>
expected (extractNotes=false): 1 block, "Visible text continues"     (native, correct per schema default)
bridge:                        2 blocks: "Visible text" + "Note content here"   (note extracted; trailing \" continues\" dropped)

Spec tag

The example is tagged expected_fail: in the spec.yaml so the parity gate downgrades it to a warning until the bridge is fixed. Once the bridge fix lands, drop the expected_fail: block.

Repro test

KAPI_PARITY_SANDBOX=$PWD/.parity \
  go test -tags parity -run TestParityIcmlSpec/note_extraction_default -count=1 -v ./parity/...

(from cli/, on branch spec/icml)

Affected upstream code

okf_icml (okapi-filter-icml) — net.sf.okapi.filters.icml.ICMLFilter's Note-handling path, all currently-shipped Okapi versions affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions