Earlier, pasting a message_link for a message in empty string topic in
the compose area resulted in #**channel_name@100** syntax instead of the
correct #**channel_name>@100** syntax.
This commit fixes that bug.
This commit tries to address the problem of not getting the
latex markdown on selecting and quoting a message which
contains normal text as well katex html elements.
It works by grabbing the parent of all the katex elements,
display (mathblocks) as well as inline expressions
and iterating over each immediate child to convert the
elements into markdown based on certain conditions.
Support has also been added to convert inline expressions to an
approximate markdown representation.
To facilitate selection of inline math expressions along with
text nodes, which are intermediate pieces of text sandwiched
between two katex spans, we transform the paste_html to
have spans instead of text nodes, so that they can be
processed by turndown js, since its filter function only
iterates through Elements and not TEXT_NODE.
The new tests have been added in katex_test_cases.json to
prevent cluttering the node tests in copy_and_paste.test.cjs.
These tests are looped over in the node tests.
Fixes#31608.
This ensures that using `^V` pastes the content from excel as
an image.
To get normal text in a formatted manner one can use
`^⇧V`.
The earlier conditions in `is_single_image` caused
the classification to fail in case of Excel pasted
content, which is why we check for the for the XML
namespaces associated with Microsoft in the pasted
HTML.
Fixes#32968.