mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-23 02:35:10 +00:00
Fix hashtag style
This commit is contained in:
parent
c60517e49a
commit
68d43e43b6
1 changed files with 3 additions and 2 deletions
|
@ -39,10 +39,11 @@ export function fromHtml(html: string): string {
|
|||
const txt = getText(node);
|
||||
const rel = node.attrs.find((x: any) => x.name == 'rel');
|
||||
const href = node.attrs.find((x: any) => x.name == 'href');
|
||||
const isHashtag = rel && rel.value.match('tag') !== null;
|
||||
|
||||
// ハッシュタグ / hrefがない / txtがURL
|
||||
if ((rel && rel.value.match('tag') !== null) || !href || href.value == txt) {
|
||||
text += txt.match(urlRegex) ? txt : `<${txt}>`;
|
||||
if (isHashtag || !href || href.value == txt) {
|
||||
text += isHashtag || txt.match(urlRegex) ? txt : `<${txt}>`;
|
||||
// メンション
|
||||
} else if (txt.startsWith('@') && !(rel && rel.value.match(/^me /))) {
|
||||
const part = txt.split('@');
|
||||
|
|
Loading…
Reference in a new issue