eramdam

"You're obviously the Grungler"

cis; 30s; Web dev; videos gamer; enjoyer of music, tinkerer of computers; ๐Ÿ‡ซ๐Ÿ‡ท in ๐Ÿ‡บ๐Ÿ‡ธ (SF bay area);
Trans & Black Lives Matter. You probably know me for Better TweetDeck!

I sometimes repost 18+ stuff that's tagged, so be aware of that (and don't be a minor).

icon by @CoolTimesOnline

ย 


My blog (with RSS!)
damien.zone/
on Mastodon (paste it into the search of your Mastodon client)
social.erambert.me/@eramdam
Bluesky (๐Ÿ˜”)
bsky.app/profile/eramdam.me
Twitter (locked, feel free to ask but don't get upset if i refuse)
twitter.com/eramdam
everything else
erambert.me/
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)