Enable CommonMark source line position information
What does this MR do?
Enables the CommonMark data-sourcepos
attribute to be added to the rendered HTML. This marks the line number and range in the markdown source of each html element. For example:
A simple tasklist
- [x] one
- [x] two
generates this
<p data-sourcepos="1:1-1:17" dir="auto">A simple tasklist</p>
<ul data-sourcepos="3:1-5:0" class="task-list" dir="auto">
<li data-sourcepos="3:1-3:9" class="task-list-item enabled">
<input type="checkbox" class="task-list-item-checkbox" checked=""> one
</li>
<li data-sourcepos="4:1-5:0" class="task-list-item enabled">
<input type="checkbox" class="task-list-item-checkbox" checked=""> two
</li>
</ul>
One benefit of this is to know when an item is clicked on, like a checkbox, which line in the markdown source it comes from.
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/55577
https://gitlab.com/gitlab-org/gitlab-ce/issues/19745
Does this MR meet the acceptance criteria?
[ ] Changelog entry added, if necessary[ ] Documentation created/updated-
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides [ ] Conforms to the database guides-
[ ] Link to e2e tests MR added if this MR has Requires e2e tests label. See the [Test Planning Process](https://about.gitlab.com/handbook/engineering/quality/test-engineering/). -
Security reports checked/validated by reviewer
Related EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9083
Edited by Brett Walker