Proposal to allow specifying a text snippet in a URL fragment inside blockquotes in CommonMarkdown

1. feature-name

Proposal to allow specifying a text snippet in a URL fragment inside blockquotes in CommonMarkdown

2. feature-description
2.1 Overview

Nearly all Markdown applications support the basic syntax outlined in the original Markdown design document. There are minor variations and discrepancies between Markdown processors — those are noted inline wherever possible.

2.2 proposal

Proposal to allow specifying a text snippet in a URL fragment inside blockquotes in CommonMarkdown

2.3 concept/idea/draft syntax
// context  |-------match-----|  context
:~:text=[prefix-,]textStart[,textEnd][,-suffix]
2.3.1 sample
https://example.com#:~:text=prefix-,startText,endText,-suffix
3. syntax, tags: ‘syntax’, ‘demo’, ‘algorithm’, ‘regex’, ‘constants’, ‘js’

const blockquote = (^> ?.+?)((\r?\n\r?\n\w)|\Z) 
// syntax: '>',  sample: > text

const pattern = /!?\[(.+)?\]\(((https?:\/\/)?[A-Za-z0-9\:\/\. ]+)(\"(.+)\")?\)/gm 
// syntax: '[]()',  sample: [text](url)

const textSnippetUrl  = :~:text=[prefix-,]textStart[,textEnd][,-suffix]
3.1. demo: blockquote in Commonmark ‘before’
> Dorothy followed her through many of the beautiful rooms in her castle.
3.2 demo: blockquote in Commonmark with cite/text-fragments ‘after’
> [cite](https://dorothy.sample.net/blog/blogtest/#:~:text=blogtest,blogtest2)
// output: Dorothy followed her through many of the beautiful rooms in her castle.

4. Questions

  1. An important and interesting question: is it possible to use text fragments in CommonMarkdown?
  2. Is it possible to have a new syntax for what I’m asking for?
  3. Why?
    • “If Commonmark start using the blockquote with attribute url and text-fragment… This allow users to navigate to the page that contains the quote.”
    • “This can help the WIGC community and the Commonmark community”
    • “Innovative feature”
    • “I would like to HTML Quotation and Citation Elements from fragmented texts”
    • To create a blockquote, add a > in front of a paragraph. But there is no possibility to add a fragmented cite.
5. Input/Output or ‘rules’
5.1 input
> This is blockquote text
5.1.2 output
<blockquote>
    <p>This is blockquote text</p>
</blockquote>
5.2 input
> [cite](https://oleb.net/2020/swift-docker-linux/#:~:text=running,container)
5.2.1 output
<blockquote cite="https://oleb.net/2020/swift-docker-linux/#:~:text=running,container">
    <p>This is blockquote text</p>
</blockquote>

6. Security/Problem/Notes

  1. If the quoted website removed the quoted text, that would break this feature. Note 1: This issue can occur when you quote something on some outside website or server., Note 2: This feature is great on local files like Obsidian, Dendron, Notion etc. Because you can have a central files, it’s easy to find various types of documents with this.
  2. I think the quoted text should be included directly in the HTML document.

7. References

example

link