Unwanted behavior: Author converts hyphens in the topic file name to underscores in the id
Posted: Tue Nov 26, 2024 6:30 am
Historically (sorry, I can't cite a specific Oxygen XML Author version), when I duplicated a DITA topic and saved the duplicate with a new file name, such as prodx-intro.dita (note the hyphen in the file name), Author automatically set the root element id attribute value to the file name without the file extension. For example: id="prodx-intro". I liked that.
However, when generating the id attribute, Author 26.1 replaces hyphens in the file name with underscores. For example: id="prodx_intro". I don't like that.
I know how to "revert" this unwanted behavior:
I'm bothering writing about this for a few reasons, including:
However, when generating the id attribute, Author 26.1 replaces hyphens in the file name with underscores. For example: id="prodx_intro". I don't like that.
I know how to "revert" this unwanted behavior:
- Select Options > Preferences > DITA > Topics
- Under New Topics: "Use the title to generate the file name", which is selected by default, change the value of "Replace non-alphanumeric characters" from an underscore (_) to a hyphen (-).
I'm bothering writing about this for a few reasons, including:
- I don't like this fix. It feels like a hack. It doesn't feel right to me to change a suboption of "Use the title to generate the file name" to change the generated id attribute value when, in my case, I'm manually specifying the file name.
- I'm wondering if this change in behavior is due to a change in the "proprietary" DITA framework I'm using rather than a change in Author itself. I'm using Author to edit DITA topics that use organization-specific DITA DTDs. That organization used to supply an installation of Author precustomized for those DTDs. However, recently, that organization changed to supplying a separate, cut-down version of those customizations that now have to be applied post-install. Possibly related: when I select Refactoring > XML Refactoring, I now no longer see "Change topic ID to file name" as a refactoring operation for DITA topics with these organization-specific DTDs.