Mailing List Archive

Is there a template / function to remove line breaks (newlines)?
Hello,

Is there a template / function to remove line breaks (newlines)?

Purpose? Quote https://lnf-wiki.eecs.umich.edu/wiki/Help:Templates

> To improve readability, usually programmers like to split the code
with newlines and indent it.


Indeed.

> Unfortunately MediaWiki software does not allow this functionality and
in many instances these purpose-built newlines are treated by the
software as content. One possible workaround is to add <!-- before each
newline character and --> after it.


That probably works but is still not pretty.


Related to a similar report of mine:

extraneous newlines caused by templates

https://phabricator.wikimedia.org/T314593

Hence my question... Is there some template or function to remove
newlines? Example:

```
{{no_new_lines|

{{Header}}

{{Title|title=
wiki page title
}}

{{#seo:
|description=wiki page description
|image=image.png
}}

[[File:image.png|thumb|100px|[[Dev/Logo|description]]]]


{{intro|
introduction text here
}}

{{Anchor|anchor}}

<!-- close braces for no_new_lines template -->
}}
```

In result, none of the following should add any newlines. No line breaks
from the templates (which aren't supposed to add line breaks) and no new
lines where were only used to separate the different items in the wiki
source code (such as {{Header}}, {{Title|...}, ...) to make the wiki
markup easier to read.

Cheers,
Patrick
_______________________________________________
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org
To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/