(In reply to comment #1)
Regex for this explicit ask for start of string or newline:
$text = preg_replace( '/(^|\n)-----*/', '\\1<hr />', $text );
Looks like works as expected
I've made an example, see https://en.wikipedia.org/w/index.php?title=User:Rezonansowy/sandbox&oldid=592775616
(In reply to Ricordisamoa from comment #3)
I believe it is working as expected, and I don't see why we should change
that. Otherwise, it could break existing pages.
No it doesn't, it's a layout bug. Risk that it could break existing pages is very low, nobody codes using layout bugs as a target, besides for similar appearance we have the <nowiki /> tag.