Skip to content

Commit 91db7b4

Browse files
committed
fix(rdfa-parser): correctly parse older-style literal nodes
1 parent c5040fa commit 91db7b4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/twelve-experts-pick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@lblod/ember-rdfa-editor': patch
3+
---
4+
5+
Add extra check to `postProcessTagAsRdfaNode` function to correctly parse older style literal nodes

packages/ember-rdfa-editor/src/utils/_private/rdfa-parser/post-process-as-rdfa-nodes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ export function postProcessTagAsRdfaNode<N>(args: PostProcessArgs<N>): void {
120120
} else {
121121
if (
122122
truthyAttribute(attributes, 'about') &&
123-
!truthyAttribute(attributes, 'data-literal-node')
123+
!truthyAttribute(attributes, 'data-literal-node') &&
124+
// Is this correct, an alternative solution would be to check on the presence of a `resource` attr here?
125+
!truthyAttribute(attributes, 'datatype')
124126
) {
125127
// same exception as above, we always interpret (property +about -content) cases as literal nodes
126128
markAsResourceNode(

0 commit comments

Comments
 (0)