Skip to content

HAR-10247: add validator rules to clean up numberingxml#800

Merged
harbournick merged 3 commits intodevelopfrom
feat_numbering_validator
Aug 29, 2025
Merged

HAR-10247: add validator rules to clean up numberingxml#800
harbournick merged 3 commits intodevelopfrom
feat_numbering_validator

Conversation

@falsaadehh
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

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!

Comment thread packages/super-editor/src/core/super-validator/super-validator.js
Comment thread packages/super-editor/src/core/super-validator/super-validator.js Outdated
Comment thread packages/super-editor/src/core/super-validator/super-validator.js
* @param {import('../../../../types.js').ValidatorLogger} logger
* @returns {{ modified: boolean, results: string[] }}
*/
export function ensureListItemHasNumIdAndLevel(listItems, editor, tr, logger) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here as the other rule

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

The new approach looks great! Let's clean up validateDocumentExport() and add tests (+ types where poss) and that should do it.

Comment thread packages/super-editor/src/core/super-validator/super-validator.js Outdated
@falsaadehh falsaadehh force-pushed the feat_numbering_validator branch from dbdf306 to 920179a Compare August 28, 2025 10:02
@falsaadehh
Copy link
Copy Markdown
Contributor Author

The new approach looks great! Let's clean up validateDocumentExport() and add tests (+ types where poss) and that should do it.

@harbournick ready for a final look :D

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

LGTM - nice work!

@harbournick harbournick merged commit 07d472a into develop Aug 29, 2025
7 checks passed
@harbournick harbournick deleted the feat_numbering_validator branch August 29, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants