Skip to content

Conversation

elpoelma
Copy link
Contributor

@elpoelma elpoelma commented Jun 13, 2025

Overview

While we technically support rdfa on heading nodes, we don't really support it in a user-friendly/good way.
To solve this issue, we could parse headings containing RDFa as block_rdfa nodes containing a simple heading node (without RDFa). An example of such a solution is included in this PR.

How to test/reproduce

  • Start the test-app
  • Insert html containing a heading with RDFa
  • Notice that it is parsed as a block_rdfa node (containing the RDFa) with a simple heading node inside.

Challenges/uncertainties

  • Currently, the changes in this PR are breaking (as the rdfa-mode of headings are no longer supported). But we could introduce a deprecation-flag or something for this change.
  • We might also want to apply this to other nodes than heading.

Checks PR readiness

  • UI: works on smaller screen sizes
  • UI: feedback for any loading/error states
  • Check cancel/go-back flows
  • Check database state correct when deleting/updating (especially regarding relationships)
  • changelog
  • npm lint
  • no new deprecations

@elpoelma elpoelma self-assigned this Jun 13, 2025
@elpoelma elpoelma added the enhancement New feature or request label Jun 13, 2025
@elpoelma elpoelma force-pushed the GN-5607-fix-old-template-literal-node-parsing branch from a086289 to ab31283 Compare June 16, 2025 14:42
Base automatically changed from GN-5607-fix-old-template-literal-node-parsing to GN-5604-fix-literal-node-rels June 18, 2025 07:36
Base automatically changed from GN-5604-fix-literal-node-rels to master June 18, 2025 07:51
Copy link
Contributor

@piemonkey piemonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For existing headings with links (made using the rdfaAware mode), this seems to work as expected, so I think just keeping the config option, but deprecating it, would work well to make this backwards compatible.

It seems that now there is a difference between headings that are loaded and headings that are inserted, as in order to insert a heading with an RDFa block, it's necessary to both insert the block and the heading. I think the most expected behaviour would be to parse headings created with RdfaAware: true as just a heading if they do not have any backlinks, and only with a wrapping block if they do. Alternatively, we could always insert a block_rdfa with every heading, but I think this would be more confusing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants