summaryrefslogtreecommitdiff
path: root/doc/yelp-xsl/C/utils.strip_newlines.page
blob: 3c6efb3bcb12ae89d5008ec41b9dcfac25cb970b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" xmlns:xsl="FIXME" style="xslt-template" id="utils.strip_newlines">
 <info>
  <link type="guide" xref="utils" group="templates"/>
  <link type="guide" xref="templates" group="utils"/>
  <desc>Strip leading or trailing newlines from a string.</desc>
  <revision version="1.0" date="2010-05-25" status="final"/>
 </info>
 <title>utils.strip_newlines</title>
 <synopsis>
  <title>Parameters</title>
  <terms>
   <item>
    <title><code>$string</code></title>
    <p>The string to strip newlines from.</p>
   </item>
   <item>
    <title><code>$leading</code></title>
    <p>Whether to strip leading newlines.</p>
   </item>
   <item>
    <title><code>$trailing</code></title>
    <p>Whether to strip trailing newlines.</p>
   </item>
  </terms>
 </synopsis>
 <p>This template strips at most one leading and one trailing newline from
 <code>$string</code>.  This is useful for preformatted block elements where leading and
 trailing newlines are ignored to make source formatting easier for authors.</p>
 <list style="compact">
  <title>Calls Templates</title>
  <item>
   <p><link xref="utils.strip_newlines"/></p>
  </item>
 </list>
</page>