MyBB Community Forums

Full Version: Non-Breaking Spaces
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
MyBB doesn't really give a lot of options for spacing and as redundant space characters and line feeds are removed it can be hard to format some things.

Title:
Non-Breaking Spaces

Short Description:
Inserts the number of non-breaking spaces contained in brackets

Regular Expression:
\[(\d)\]

Replacement:
<script type="text/javascript">for(x=0;x<$1;x++){
document.write(String.fromCharCode(160));
}</script>

This can be used to pad lists:

[list=1][*]Hello
[1]
[1]
[1]
[*]Three spaces between list items[/list]

Or just to indent paragraphs [3] or [5]

Any number between 1-9 will return that many nbsps Smile

I couldn't do this without JavaScript though so if anyone knows another way to do it let me know Smile