eden

gamer girl incarnate

๐„† composer & percussionist ๐„ excitable lesbian ๐„ i play a lot of hardcore Destiny ๐„ a sweet face, and funny little horns! ๐„‡

โ™ฎ

twitter ๐„ช letterboxd ๐„ช backloggd

โ™ญโ™ฎโ™ฏ

You must log in to comment.

in reply to @jkap's post:

wow!

is this going to be a full "all line breaks are preserved" or more of a "two spaces on the line before aren't required to preserve a single line break, but white space is still generally collapsed"?

(saving these details for patch notes is valid lol, I'm just excited)

i appear to be the only one who actually prefers the line break handling of markdown. obsidian has an option to keep line breaks and i always have it off

there isn't really a good way for us to do this since we don't have a system in place for per-post settings and doing it account-wide wouldn't get you what you're looking for. it's something we can look in to when we do the larger post composer rewrite down the road.

its a bit hacky but if you want a userscript for it: here you go.

// ==UserScript==
// @name         old markdown to cohost post
// @author       https://cohost.org/lexi
// @match        https://cohost.org/*/post/compose
// ==/UserScript==
function md2ch() {
    let el = document.querySelector("textarea[placeholder*='post body']")
    el.value = el.value
        .replaceAll('  \n', '<br>')
        .replaceAll(/\n(?!\n)/g, ' ')
        .replaceAll(/\n\n+/g, '\n\n')
    el.dispatchEvent(new Event('input', {bubbles:true}));
}
let buttonText = `<button class="rounded-lg bg-foreground px-2 py-1 text-text">md2ch</button>`
setTimeout(() => {
    let el = document.createElement('div');
    el.innerHTML = buttonText;
    el.addEventListener('click', md2ch)
    document.querySelector('article > header > div')
        .insertAdjacentElement('afterend',el)
}, 2000)