Preventing line breaks in elements
alexwlchan.net
Preventing line breaks in elements
1–10 of 23 posts
Re: Preventing line breaks in <code> elements
#2Re: Preventing line breaks in <code> elements
#3You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#4You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#5You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#6You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Parsing HTML with a regex is never a good option, but it's sometimes the only option.
The more fundamental question for me is why the author didn't decide to make make code blocks non-breaking by default, or just add the class annotations when he writes the HTML?
Re: Preventing line breaks in <code> elements
#7You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#8You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#9You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
Re: Preventing line breaks in <code> elements
#10You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
You can absolutely parse HTML with regex, so long as the document is finite in length. Every finite language is regular, hence can be parsed with regex's.