jelovirt / org.lwdita

LwDITA parser for DITA-OT
http://lwdita.org/
Apache License 2.0
25 stars 19 forks source link

keys do not resolve #176

Closed darrenn-jackson closed 1 year ago

darrenn-jackson commented 1 year ago

Neither the "old" (current?) syntax of [key-id], nor the newer <span data-keyref="key-id"/> syntaxes result in resolved keys in output generated from MDITA files when a key is defined in the parent map. [key-id] gets becomes <span data-keyref="key-id"/> in DITA and <span data-keyref="key-id"/> becomes <xref keyref="key-id"/> in DITA (dita transtype). The key text doesn't get substituted when transforming to HTML5.

I'm running DITA-OT version 4.0.2 with version 5.10 of the lwdita plugin.

jelovirt commented 1 year ago

Could you attach a small test case that reproduces the issue?

There is not LwDITA plug-in version 5.10. I assume you mean 5.1.0?

darrenn-jackson commented 1 year ago

You are correct, I have 5.1.0 of the plug-in.

It turns out that I didn't have the topic that contains the keyref in the map. I didn't catch this before because the normalized DITA file (with the unresolved keys) ended up in the output directory anyway. The missing file is a link target from another file that was included in the map, so I think that's why DITA-OT found it and passed it though to the output directory.

Once I added it, the current [key-id] syntax resolved as <xref keyref="key-id"><keyword>KEY_VALUE</keyword></xref> and the newer syntax proposed by the draft spec resolved as <ph keyref="key-id">KEY_VALUE</ph>. That was for transforming to normalized DITA.

When transforming to HTML5, the key value text gets substituted exactly as expected for both syntaxes.