mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
fix conversion of empty links to mfm URL
This commit is contained in:
parent
8d628aa50b
commit
a5f5de46da
1 changed files with 12 additions and 11 deletions
|
@ -72,17 +72,11 @@ export class MfmService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.tagName === 'br') {
|
switch (node.tagName) {
|
||||||
|
case 'br': {
|
||||||
text += '\n';
|
text += '\n';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't produce invalid empty MFM
|
|
||||||
if (node.childNodes.length < 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (node.tagName) {
|
|
||||||
case 'a': {
|
case 'a': {
|
||||||
const txt = getText(node);
|
const txt = getText(node);
|
||||||
const rel = node.attribs.rel;
|
const rel = node.attribs.rel;
|
||||||
|
@ -128,9 +122,16 @@ export class MfmService {
|
||||||
|
|
||||||
text += generateLink();
|
text += generateLink();
|
||||||
}
|
}
|
||||||
break;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't produce invalid empty MFM
|
||||||
|
if (node.childNodes.length < 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (node.tagName) {
|
||||||
case 'h1': {
|
case 'h1': {
|
||||||
text += '**【';
|
text += '**【';
|
||||||
appendChildren(node.childNodes);
|
appendChildren(node.childNodes);
|
||||||
|
|
Loading…
Add table
Reference in a new issue