forked from FoundKeyGang/FoundKey
fix errors from quote string removal
The parse5 tree does not have the full DOM methods and attributes.
This commit is contained in:
parent
0f6cf83add
commit
7ee6a09cf2
2 changed files with 3 additions and 2 deletions
|
@ -204,7 +204,8 @@ export function fromHtml(html: string, hashtagNames?: string[], quoteUri?: strin
|
||||||
|
|
||||||
case 'span':
|
case 'span':
|
||||||
{
|
{
|
||||||
if (node.classList.contains('quote-inline') && quoteUri && getText(node).trim() === `RE: ${quoteUri}`) {
|
const nodeClass = node.attrs.find(({ name }) => name === 'class');
|
||||||
|
if (/\bquote-inline\b/.test(nodeClass) && quoteUri && getText(node).trim() === `RE: ${quoteUri}`) {
|
||||||
// embedded quote thingy for backwards compatibility, don't show it
|
// embedded quote thingy for backwards compatibility, don't show it
|
||||||
} else {
|
} else {
|
||||||
appendChildren(node.childNodes);
|
appendChildren(node.childNodes);
|
||||||
|
|
|
@ -201,7 +201,7 @@ export async function createNote(value: string | IObject, resolver?: Resolver =
|
||||||
} else if (typeof note._misskey_content !== 'undefined') {
|
} else if (typeof note._misskey_content !== 'undefined') {
|
||||||
text = note._misskey_content;
|
text = note._misskey_content;
|
||||||
} else if (typeof note.content === 'string') {
|
} else if (typeof note.content === 'string') {
|
||||||
text = htmlToMfm(note.content, note.tag, quote.uri);
|
text = htmlToMfm(note.content, note.tag, quote?.uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
// vote
|
// vote
|
||||||
|
|
Loading…
Reference in a new issue