Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

Template:Nowordbreak: Difference between revisions

m
Move the documentation to subpage
imported>FrozenPlum
m (3 revisions imported: Imported from help.fandom.com Extension:DPL3 pages, which are for the obsolete version of DPL3 extension for MediaWiki 1.33, to adapt to forked (newer) extension version.)
imported>FrozenPlum
m (Move the documentation to subpage)
 
Line 1:
<onlyinclude><includeonly>{{#vardefine:n|{{{2|{{{length|0}}}}}}}}<!--
-->{{#vardefine:text|{{{1|{{{text|}}}}}}}}<!--
-->{{#vardefine:sub|{{#sub:{{#var:text}}|0|{{#var:n}} }} }}<!--
Line 7:
|{{#var:text}}
|{{#rmatch:{{#var:sub}}|/[\W0-9]$/|{{#var:sub}}|{{#rmatch:{{#var:sub+}}|/[\W0-9]$/|{{#var:sub}}|{{#rmatch:{{#var:sub}}|/^(.*[\s]).*$/|$1|{{#var:sub}}}}}}}}
}}</includeonly><noinclude/onlyinclude>
{{Documentation}}
This template will return the first n characters of a string, without breaking words. Numbers however, will be broken apart.
 
Note: This template requires the [[mw:Extension:RegexFunctions|RegexFunctions Extension]].
 
=== Usage examples ===
{|
! Code !! Gives
|-
| <code><nowiki>{{nowordbreak|Testing, testing, 123|11}}</nowiki></code>
| {{nowordbreak|Testing, testing, 123|11}}
|-
| <code><nowiki>{{nowordbreak|Testing, testing, 123|20}}</nowiki></code>
| {{nowordbreak|Testing, testing, 123|20}}
|}
 
[[tr:Şablon:Nowordbreak]]
[[Category:Templates]]
</noinclude>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.