NateDhaliwal is looking for a way to retrieve the raw, unparsed text that a user highlights when quoting, rather than the Markdown-converted text. They mention that quoteState.buffer provides the Markdown text, but they need the original text before conversion. NateDhaliwal suggests a workaround involving converting the raw post to Markdown and extracting the section from the original text, but notes the potential issues with character changes during conversion. Moin suggests looking at how fast edit and copy quote handle text selection. NateDhaliwal demonstrates that copying a quote converts bullet points to asterisks, even if the original used plus signs. sam explains that retrieving the original text is challenging due to the lossy process of converting HTML to Markdown and the lack of support for reverse mapping in markdown.it. NateDhaliwal acknowledges the difficulty of the task.
I understand that quoteState.buffer gets the Markdown text that the user highlights when quoting, and is one of the things passed into the quote-share-buttons-before plugin outlet (accessed by this.args.data.quoteState.buffer). How do I get the raw, unparsed text that the user is highlighting, before it got converted to Markdown? Is it possible to “de-Markdown” the post? Is this possible at all?
פתרון עקיף שאני יכול לחשוב עליו הוא להמיר את הפוסט הגולמי ל-Markdown (איך, אני לא בטוח), להסתכל על אינדקס ההתחלה והסיום של הבחירה בטקסט המומר, ואז להשתמש בזה כדי לחלץ את הקטע מהטקסט המקורי. הבעיה תהיה שאצטרך להניח שאף תו לא משתנה, כלומר, Markdown מחליף תווים 1:1.
In this case, copying the quote converts the bullet point to a * in the quote, when I actually used +. I’m looking for a way to get the plus instead of the asterisk.