cpsdqs / prechoster

cohost.org post preprocessor. it’s for posting on cohost.org. cohost.org posting. with css. dangerous css posting. you can be making a post that is so cascaded. in a style sheets way. advanced posting on a website online. you can use web technologies in a web browser. to make posts. posting online right now today. lol how long can i make this descr
https://cloudwithlightning.net/random/chostin/prechoster/
MIT License
68 stars 8 forks source link

more accurate markdown renderer #4

Open easrng opened 1 year ago

easrng commented 1 year ago

everything renders properly now including emojis, link previews, a cohost plus on and off checkbox, and the "Read More" cut (though it's just implemented as a details/summary rn so it doesn't look exactly the same as on cohost). i'm marking this as a draft because it doesn't give you feedback on what the sanitizer removed like prechoster does now. also licensing might be an issue, almost everything in src/markdown was copied out of cohost's source maps and edited until it built properly.

easrng commented 1 year ago

here's a comparison:

it's not perfectly accurate to cohost (idk why the footnote placement is different) but it's wayyyyyy closer

cpsdqs commented 1 year ago

oh, neat! hmmmmmmmmm yeah before merging this i’d definitely like to see some kinda confirmation that staff (*tags @jkap*) are ok with this level of reversing in a public repo[^1][^2]. i had kinda given up and was waiting for a potential Official Reference Renderer™ when the public API releases…

i should probably also add some kinda code license before accepting a contribution this big lol added MIT which was already in package json apparently

for a quick review:

[^1]: there are source maps?? [^2]: “You further agree not to copy, translate, port, modify or make derivative works of any portion of the Services” which the cohost-inherited.less file is probably technically already in violation of but,

easrng commented 1 year ago
cpsdqs commented 1 year ago

ok until it is Probably Legal to include the cohost renderer code in this repo, i have for now implemented a terrible, terrible hack in bb2533b. It simply loads the appropriate webpack chunks containing the renderer from cohost dot org itself. I don’t know how cohost does deployments or whether they keep the older static files around, so I’ve also kept the current renderer as fallback if it ever breaks.

easrng commented 1 year ago

that's awful (positive)