I'm writing a board software which have basic styling such as bold, italic, underline, strikethrough. I use the bbcode syntax for them. For full bbcode support/compatible, I will need regex, but for that basic styling, I found that I can do str_replace with [b] [i] [/close-tag]... replaced with after I do a htmlspecialchars() sanitize. Could there be a problem with that?
Asked
Active
Viewed 19 times
0
-
This is called **markdown** – Your Common Sense Aug 03 '23 at 09:55
-
But anyway, if you want to stick with this ancient cumbersome technology, you may want to check existing answers – Your Common Sense Aug 03 '23 at 09:57
-
I don't implement markdown. Markdown is something "\_i\_ \_\_u\_\_ \*\*b\*\*". [b] [/b] is bbcode. – Someone1611 Aug 03 '23 at 10:18
-
Markdown is far superior to bbcode. Typing `*b*` is just natural, as opposed to `[b]b[/b]`. Nobody uses bb nowadays for a reason. – Your Common Sense Aug 03 '23 at 10:23
-
Yeah, but I'm asking is it a good idea to just str_replace [b] with ? – Someone1611 Aug 04 '23 at 01:35
-
And I told you already that you may want to check existing answers. – Your Common Sense Aug 04 '23 at 04:24