Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making ODF style IDs unique for CSS/HTML #48

Merged
merged 8 commits into from
Jun 9, 2023
Merged

Conversation

svanteschubert
Copy link
Contributor

…ith '-' as glue character

@svanteschubert svanteschubert changed the title Adding in case of a style named Default the @style:family as prefix w… Making ODF style IDs unique for CSS/HTML Jun 7, 2023
@svanteschubert
Copy link
Contributor Author

Problem

The problem in above issue were that two styles had similar names but different style:family, which lead to unintended formatting. See https://bugs.documentfoundation.org/show_bug.cgi?id=155244

Solution

Making ODF style IDs unique for HTML/CSS by adding a prefix (the @style:family with '-' as glue character) to their style name.

Solution Details

  • Adding a prefix (the @Style:family with '-' as glue character) to each style name twice:
    1. in the CSS header for each style name
    2. in the HTML body for each style name
  • Added a function (XSLT named template) to map an element name to a style:family to get the the @style:family in the body
  • Enhanced the mapping of all style attributes to create a single CSS class attribute with all style names a space separated list of this class attribute (trimming the value later). Wasting just a bit of performance as in case of multiple style names each will create an class attribute and overwrite the prior (but XSLT is not C++) ;-)

@mistmist mistmist merged commit fd96dcd into master Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants