Use FEP-c16b: Formatting MFM functions #410

Open
ilja wants to merge 11 commits from ilja/akkoma-fe:use_fep-c16b_formatting_mfm_functions into develop
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 56a59e1b55 - Show all commits

View file

@ -191,6 +191,21 @@ export default {
if (this.handleLinks && attrs?.['class']?.includes?.('h-card')) {
return ['', children.map(processItem), '']
}
// Turn data-mfm- attributes into a string for the `style` attribute
// If they have a value different than `true`, they need to be added to `style`
// e.g. `attrs={'data-mfm-some': '1deg', 'data-mfm-thing': '5s'}` => "--mfm-some: 1deg;--mfm-thing: 5s;"
let mfm_style = Object.keys(attrs).filter(
(key) => key.startsWith('data-mfm-') && attrs[key] !== true
).map(
(key) => '--mfm-' + key.substr(9) + ': ' + attrs[key] + ';'
).reduce((a,v) => a+v, "")
if (mfm_style !== "") {
return [
opener.slice(0,-1) + " style=\"" + mfm_style + "\">",
children.map(processItem),
closer
]
}
}
if (children !== undefined) {

View file

@ -1,7 +1,7 @@
<template>
<div
class="StatusBody"
:class="{ '-compact': compact, 'mfm-disabled': !renderMisskeyMarkdown }"
:class="{ '-compact': compact }"
>
<div class="body">
<div