MyBB Community Forums
Non-Breaking Spaces - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: Non-Breaking Spaces (/thread-125947.html)



Non-Breaking Spaces - Wildcard - 2012-09-10

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