]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Add %nowrap% to facilitate more complex formatting.
authorBen Schmidt <none@none>
Mon, 12 Mar 2012 04:46:20 +0000 (15:46 +1100)
committerBen Schmidt <none@none>
Mon, 12 Mar 2012 04:46:20 +0000 (15:46 +1100)
ChangeLog
README.listtexts
src/prepstdreply.c

index 718090f7b53af9476f6123f211e37816f0ad93aa..7df63968a39ab1aea1436f25cebbd3acd5557722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+ o Add %nowrap% to facilitate more complex formatting
  o Add subscription ability to php-admin
  o Add ability to except characters from width reckoning (and be zero-width)
    to facilitate wrapping even more languages well
index f030a425af0c15d61216e01508f9b68a25a60e66..25b210480e2f67d408d263919e1120c44ccc8158 100644 (file)
@@ -251,12 +251,20 @@ Wrapping needs to be enabled for each paragraph with:
 
 - %wrap%
 - %wrap W%
-  concatenate and rewrap lines until the next empty or whitespace-only line to
-  a width of W (or 76 if W is omitted); second and later lines are preceded
-  with as many spaces as the width preceding the directive; the width is
-  reckoned including any text preceding the directive and any indentation
-  preserved from a file which included the current one, so it is an absolute
-  maximum width
+  concatenate and rewrap lines until the next empty line, whitespace-only line,
+  or %nowrap% directive to a width of W (or 76 if W is omitted); second and
+  later lines are preceded with as many spaces as the width preceding the
+  directive; the width is reckoned including any text preceding the directive
+  and any indentation preserved from a file which included the current one, so
+  it is an absolute maximum width
+
+To turn off wrapping before the end of a paragraph, use:
+
+- %nowrap%
+  stop wrapping; usually placed at the end of a line so the following line
+  break is honoured but all preceding text is properly wrapped; if you want
+  wrapping to continue after the break, you need to use %wrap% to turn it on
+  again on the following line
 
 To cater for various languages, there are a number of different wrapping modes
 that can be set. These can be set either before or after wrapping is specified,
index b499f8dd65550190d15c54840f334cdc47642f47..d9e5df612476481a73bc6a7cab98fe9213af170c 100644 (file)
@@ -969,6 +969,13 @@ static int handle_directive(text *txt, char **line_p, char **pos_p,
                        *line_p = line;
                        return 0;
                }
+       } else if(strcmp(token, "nowrap") == 0) {
+               txt->wrapwidth = 0;
+               line = concatstr(2, line, endpos + 1);
+               *pos_p = line + (*pos_p - *line_p);
+               myfree(*line_p);
+               *line_p = line;
+               return 0;
        } else if(strcmp(token, "ww") == 0 ||
                        strcmp(token, "wordwrap") == 0 ||
                        strcmp(token, "cw") == 0 ||