HAR-10247: add validator rules to clean up numberingxml#800
HAR-10247: add validator rules to clean up numberingxml#800harbournick merged 3 commits intodevelopfrom
Conversation
harbournick
left a comment
There was a problem hiding this comment.
Looking good! Like where it is going, but the validator rules in the export validator need to address xml issues not editor state issues. Your state validators may be useful and important as they are in the active doc validation (but we need to really understand and confirm to make sure we don't introduce issues in live docs) so we'll remove them for now but would encourage further investigation there.
Ping me if you have any questions!
| * @param {import('../../../../types.js').ValidatorLogger} logger | ||
| * @returns {{ modified: boolean, results: string[] }} | ||
| */ | ||
| export function ensureListItemHasNumIdAndLevel(listItems, editor, tr, logger) { |
There was a problem hiding this comment.
See note above. Let's remove this validation rule for now (its state validation). I'm not sure if we should or should not add it to active document validation. It would be necessary to find an example file where this validation actually takes effect and verify that the behavior is needed. It is very possible that it is needed (and would be most obvious in collaborative files but maybe the markdown test above might work).
| * @param {import('../../../../types.js').ValidatorLogger} logger | ||
| * @returns {{ modified: boolean, results: string[] }} | ||
| */ | ||
| export function ensureNumIdHasDefinition(listItems, editor, tr, logger) { |
There was a problem hiding this comment.
same here as the other rule
harbournick
left a comment
There was a problem hiding this comment.
The new approach looks great! Let's clean up validateDocumentExport() and add tests (+ types where poss) and that should do it.
dbdf306 to
920179a
Compare
@harbournick ready for a final look :D |
No description provided.