Support defining text nodes directly in the root document
What does this MR do and why?
-
NOTICE: This change is behind a the
preserve_unchanged_markdown
feature flag. - Context: This change is part of a larger effort to preserve unchanged Markdown in the Content Editor. For this effort, we need to support client-side parsing of Markdown content.
This MR fixes a bug in the Content Editor’s client-side Markdown parser where text nodes that are direct children of the root document make the AST to ProseMirror document fail. The bug is fixed by wrapping those text nodes in a paragraph. This is what a text node looks like when it is a direct child of the root node:
{
"type": "root",
"children": [
{
"type": "html",
"value": "<i class=\"foo\">\n *bar*\n</i>",
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 5,
"offset": 28
}
}
}
],
}
That AST represents the Markdown snippet in example 164 of the Commonmark spec: https://spec.commonmark.org/0.30/#example-164
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Edit or create a Wiki page
- Enter the following Markdown snippet in the Classic Markdown Editor. The example comes from the Markdown spec: https://spec.commonmark.org/0.30/#example-164
<i class="foo"> *bar* </i>
- Switch to rich text mode. You should see the same result as the screenshots above.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %15.1
assigned to @ealcantara
Suggested Reviewers (beta)
The individuals below may be good candidates to participate in the review based on various factors.
You can use slash commands in comments to quickly assign
/assign_reviewer @user1
.Suggested Reviewers @himkp
,@mrincon
,@dpisek
,@oregand
,@pburdette
If you do not believe these suggestions are useful, please apply the label Bad Suggested Reviewer. You can also provide feedback for this feature on this issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/357923
.Automatically generated by Suggested Reviewers Bot - an experimental ML-based recommendation engine created by ~"group::applied ml".
1 Warning featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
If needed, you can retry the
danger-review
job that generated this comment.Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer frontend Fernando Arias ( @farias-gl
) (UTC-5, 1 hour behind@ealcantara
)Olena HK. ( @ohoral
) (UTC+3, 7 hours ahead of@ealcantara
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
Generated by
Danger- Resolved by Illya Klymov
- Resolved by Illya Klymov
Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits 9dc66dd1 and 188d97ee
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 3.46 MB 3.46 MB - 0.0 % mainChunk 1.94 MB 1.94 MB - 0.0 %
Note: We do not have exact data for 9dc66dd1. So we have used data from: b1f0ef03.
The intended commit has no webpack pipeline, so we chose the last commit with one before it.Please look at the full report for more details
Read more about how this report works.
Generated by
Danger- Resolved by Illya Klymov
@thomasrandolph: Could you review this MR, please?
requested review from @thomasrandolph
- Resolved by Illya Klymov
Allure report
allure-report-publisher
generated test report!review-qa-blocking:
test report for 188d97eeexpand test summary
+-------------------------------------------------------------------+ | suites summary | +----------------------+--------+--------+---------+-------+--------+ | | passed | failed | skipped | flaky | result | +----------------------+--------+--------+---------+-------+--------+ | Plan | 41 | 0 | 1 | 41 | ❗ | | Verify | 12 | 0 | 1 | 12 | ❗ | | Manage | 36 | 0 | 2 | 38 | ❗ | | Create | 23 | 0 | 2 | 23 | ❗ | | Package | 0 | 0 | 1 | 0 | ➖ | | Protect | 2 | 0 | 0 | 2 | ❗ | | Version sanity check | 0 | 0 | 1 | 0 | ➖ | | Configure | 0 | 0 | 1 | 0 | ➖ | +----------------------+--------+--------+---------+-------+--------+ | Total | 114 | 0 | 9 | 116 | ❗ | +----------------------+--------+--------+---------+-------+--------+
Setting label(s) devopscreate sectiondev based on ~"group::editor".
added devopscreate sectiondev labels
requested review from @xanf and removed review request for @thomasrandolph
@thomasrandolph
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
enabled an automatic merge when the pipeline for 96a484cc succeeds
added 113 commits
-
026fed4c...9dc66dd1 - 112 commits from branch
master
- 188d97ee - Allow text nodes inside the root document
-
026fed4c...9dc66dd1 - 112 commits from branch
mentioned in commit 7dc2ba2c
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
mentioned in issue gitlab-com/www-gitlab-com#13386
added releasedpublished label
added releasedcandidate label and removed releasedpublished label
mentioned in merge request gitlab-com/www-gitlab-com!135591