XML minimal diff saving bug with text markup - #9326
Conversation
… such for XML minimal diff algorithm to work correctly
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9326 +/- ##
=======================================
Coverage 96.89% 96.89%
=======================================
Files 35 35
Lines 3702 3704 +2
=======================================
+ Hits 3587 3589 +2
Misses 115 115
🚀 New features to boost your workflow:
|
|
Build successful. Some useful links:
This preview will be removed when the branch is merged. |
mbollmann
left a comment
There was a problem hiding this comment.
Two of the tags don't belong here, the rest must be added, yes.
|
Okay, if I remove (
"<abstract><tex-math>a</tex-math> <b>xxx</b></abstract>",
"<abstract><tex-math>a</tex-math> xxx</abstract>",
"<abstract><tex-math>a</tex-math> <b>xxx</b></abstract>",
),Pretty wild to me that this wasn’t caught earlier. In any case, adding this to |
|
I think the solution is to just stop the minimal-diff algorithm from recursing further into markup-containing tags. Strange that (i) this wasn’t how it already worked, and (ii) we haven’t encountered a situation triggering a bug from this earlier. |
|
I was confused by It would be great if the list could be limited to category (b) and that was sufficient to block recursing into the MarkupText when computing the minimal diff. |
|
Also worth noting that the list of MarkupText-valued attributes could be extended in the future e.g. for awards (#9101). |
It’s not just for the minimal-diff, but also for indentation. I don’t think there is any mixing of categories here: |
|
Incidentally, that’s why |
|
How is it used for indentation? |
Then |
Yes, that's what I commented above and why I already removed it again. |
From a quick look at the code: Markup-containing tags are not recursed into and will not get indentation after them if they have children. It may be that for this purpose, listing the "high-level" markup tags suffices, but I still contend that the semantics of |
|
@mbollmann What's the next step here? |
Merging. :) Since I pushed my own changes here I’d find it weird to self-approve, but @mjpost has done this now, so I think we’re good. |
|
Oh, hmm, I want to try some more test cases as I'm not sure:
|
They can never contain any children, as per the schema, so by their nature they can’t be recursed into.
Oh, that’s a good point, by the semantics I have given it indeed probably doesn’t belong there. |
|
Also, I just realized that if titles and abstracts aren't being recursed into, then by definition any markup isn't being recursed into. |
|
(cannot merge because changes were requested) |
|
I assume you addressed his comments? I removed him as a reviewer, not sure why it's blocked |
|
Hmm I had to explicitly dismiss the review. That was confusing |
closes #9324
This lists the markup fields in
TAGS_WITH_MARKUP, which seems to do the trick. I don't fully understand why this matters though...