I've got a phone number in my markdown that tends to break over the end of the line. In HTML I could wrap it in a <nobr>
tag to have it keep together properly. What is the correct way to do this in markdown?
There are a few different methods to enforce a line break in the same paragraph in Markdown syntax: HTML's <br /> , backslash and double space.
To create a line break or new line ( <br> ), end a line with two or more spaces, and then type return. This is the first line.
The <nobr> HTML element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.
The white-space property has numerous options, all of which define how to treat white space inside a given element. Here, you have set white-space to nowrap , which will prevent all line breaks.
Apparently I didn't realize you could just embed html in markdown.
<nobr>[1-111-111-1111](tel:11111111)</nobr>
works fine
You can use non-break hyphen character ( ‑
)
1‑111‑111‑1111
for
1-111-111-1111
Or you could need the phone number format with spaces in between, then use no-break space character (  
)
1 111 111 1111
for
1 111 111 1111
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With