fix errors from quote string removal
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details

The parse5 tree does not have the full DOM methods and attributes.
This commit is contained in:
Johann150 2022-11-21 19:43:56 +01:00
parent 0f6cf83add
commit 7ee6a09cf2
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
2 changed files with 3 additions and 2 deletions

View File

@ -204,7 +204,8 @@ export function fromHtml(html: string, hashtagNames?: string[], quoteUri?: strin
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
} else {
appendChildren(node.childNodes);

View File

@ -201,7 +201,7 @@ export async function createNote(value: string | IObject, resolver?: Resolver =
} else if (typeof note._misskey_content !== 'undefined') {
text = note._misskey_content;
} else if (typeof note.content === 'string') {
text = htmlToMfm(note.content, note.tag, quote.uri);
text = htmlToMfm(note.content, note.tag, quote?.uri);
}
// vote