Share your repls and programming experiences

← Back to all posts
HR Tag being displayed outside of a web browser
StudentFires (71)

First of all, I doubt this was the best way to go about doing this, so if anyone has a better idea, please leave it in the comments

Background Info

In HTML, there are HTML entities (Practicially Unicode escape characters) characters for every character you can get from Unicode, there's the <br> tag to create an end line \n or \n\r character (or character sequence). But, there's one tag that can't be recreated by any means necessary, and that tag is the horizontal rule <hr> until now.

What I did

I present to you, a sequence of characters capable of recreating its effect, all compacted into one small NodeJS program (Although it would work in other languages such as C++).

The HTML tag looks like this:

The coded version looks something like this:

And that's only half of its size.

Yet, this massive sequence can be made into a loop and stored in a variable for easy reuse.