You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you putting this content in <pre><code> block? That is the happy path. If you're doing something else then yes you need to jump thru a lot of hoops to deal with spacing and newlines and things you get for "free" when on the happy path.
Indents
We do no special processing of tabs (or spacing)... if you want to convert them to spaces, you need to do that yourself. If you want to style them with CSS (usually simpler) you can use tab-size. But if you're just putting spaces into normal HTML - again HTML doesn't care (it will squash them all to a single space, as HTML does).
Newlines
Newlines (typically) mean nothing in HTML outside of <pre> . If you're having to add <br> yourself then I'd guess you're not using <pre>, in which case - yes, that's just what you must do.
If you don't want to deal with these things, use <pre><code> blocks as strongly recommended by our docs.
Describe the issue/behavior that seems buggy
The newline formatting and indentation of the code is lost after parsing with hilight.
Sample Code or Instructions to Reproduce
Starting with a string literal:
I run the following
which results in no newlines and a loss of indentation.
I am able to fix the newlines by appending
.replace(/\n/g,' <br> ')
to the end, but have had no such luck regarding the initial indentation.Update:
Inline indentation can be achieved through
It almost feels like this should be done in the background, with a possible argument/switch.
The text was updated successfully, but these errors were encountered: