clip

no thanks i'm from massachusetts

sega dreamcast enthusiast, electric beast, artist, in that order.

💍 @masklayer

icon @brushy

My scrobbles

This user can say it.

This user wants to eat sheet metal.

This user knows every animal personally.

This user is full of love and store brand red bull.


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)