• she/her, they/them, sie/sie/ir, ask

dyke, poetess, games writer, &cet.

wow! this lesbian can pierce space and time!


if you can see this,
you have permission to message me on discord

jkap
@jkap

minor change coming (i think) today to fix a major gripe i've seen people have with markdown

yes it's single line breaks

yes it's bringing in a New Age Of Posting so that old posts are unimpacted

yes it's requiring some changes to how Ages Of Posting work internally

full details coming in patch notes


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)