from sunmark@programming.dev to programming_languages@programming.dev on 23 Mar 04:06
https://programming.dev/post/27385814
We’ve just made Marksafe even more intuitive and concise with shorthand syntax and delimiter escaping!
✅ New Shorthand Syntax – Write cleaner markup with:
👉 [uli]item1;;item2;;item3[/uli]
instead of [ul][li]item1[/li][li]item2[/li][li]item3[/li][/ul]
👉 [bq]A blockquote example[/bq]
instead of [blockquote]A blockquote example[/blockquote]
✅ Delimiter Escaping – Need to use ;;
, ,
, or other special characters inside content or attributes? Just escape them with \
:
👉 [a]href=https://example.com,Click here to see \,escaped commas[/a]
Marksafe keeps all the flexibility of HTML while staying lightweight and readable—perfect for devs who need powerful, secure, and extensible rich text formatting.
🔗 Check it out here: github.com/mksunny1/marksafe
💬 Docs & API: github.com/mksunny1/marksafe/blob/…/Marksafe.md
💖 Support & Contribute: github.com/sponsors/mksunny1
Try it out and let me know what you think!
threaded - newest
In what way is it cleaner than Markdown?
That looks like replicating HTML with additional complexity.
Markdown is good because it’s simple and text-based. It has a simple syntax. Looking at Marksafe looks like you have to learn more syntax than Markdown and more than HTML.
I can see that additional syntax can make it more concise than HTML. But intuitively I wouldn’t conciseness at the cost of additional complexity cleaner.
.
Fixed the error in the title. Hope we have common grounds now? Don’t nitpick 🙂.
It’s not supposed to be additional complexity. It is pretty much HTML with simple transformations: [a]href=./link/url,A link[/a]. Then just those tweaks for more concision:
It’s supposed to be a great bridge between Markdown and HTML. I needed this for my own project and md was not flexible enough, never mind all the parsers were giving one safety caveat or the other.
What do you mean by it’s not supposed to be additional complexity?
I can see where it could be useful. But I also see its cost. Obviously, it doesn’t want to add additional complexity. But when you add additional syntax and semantics you can’t get around that.
Haha. I think I understand you better. I am happy you can see where it could be useful. But you don’t want anything more complex than HTML for text editing. In reality one is not really going to need to learn all of HTML to use it. It can go from simple Markdown-like usage (for regular users using a few tags at a small extra cost in terms of verbosity) to more advanced use cases involving more complex elements or styles (for devs). So that is where I am coming from in the design. You are right to say knowing Marksafe entails knowing HTML and a bit more, but I don’t think that is exactly a bad thing.