-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add questionable hacks for NamedNodes with external subjects #1140
base: master
Are you sure you want to change the base?
Conversation
@@ -1297,7 +1304,8 @@ export class RdfaParser<N> { | |||
) { | |||
// Validate IRIs | |||
if ( | |||
(subject.termType === 'NamedNode' && subject.value.indexOf(':') < 0) || | |||
// More hacking... Does including '#' make sense? | |||
(subject.termType === 'NamedNode' && subject.value.indexOf(':') < 0 && subject.value.indexOf('#')) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessarily correct, as IRIs do not need to contain a hash symbol, that is just an often used delimiter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't requiring them to contain #
, the logic is the other way around. If it does not contain :
and does not contain #
, then it's not an IRI, so ignore it. This is here to catch the case that we have in article structure nodes where the subject is #
(or at least, that's what we have after my hack to handle the nodes with resource="#"
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see what you mean, was a bit confused. Would if not be necessary to negate the indexOf('#')
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good spot. It was meant to mimic the :
test, so subject.value.indexOf('#') < 0
. What I wrote is nonsense as it's only false if it's testing a string that starts with #
...
35fca9d
to
6606d47
Compare
4cba0a5
to
77b55c7
Compare
I have some ideas for this I wanna try |
Overview
Draft PR as I thought I should put it somewhere... I thought this was necessary for the blackbox tests on the plugin repo, but it seems that isn't the case. It is necessary in order to compare parsing on rdfa.info/play however...
connected issues and PRs:
#1139
lblod/ember-rdfa-editor-lblod-plugins#387
lblod/ember-rdfa-editor-lblod-plugins#388
Setup
N/A
How to test/reproduce
Import the HTML from any article structures into the editor, then compare the exported HTML to the original in rdfa.info/play.
Challenges/uncertainties
Checks PR readiness