Re: [Groff] Trying to escape user input.

2008-04-22 Thread Ralph Corderoy
Hi Mike, > I'm fairly certain that the things I need to translate are > "\" --> "\[rs]", > "\n." --> "\n\&." There's /^'/ as well as /^\./. Cheers, Ralph.

Re: [Groff] Trying to escape user input.

2008-04-22 Thread brian m. carlson
On Tue, Apr 22, 2008 at 11:37:22AM -0500, Mike Burns wrote: Are they any other gotcha's people have experienced out there? Remember that strings, requests, macros, and diversions are all in the same namespace. Therefore, if you define a macro called "tl", it will override the request of the

Re: [Groff] Trying to escape user input.

2008-04-22 Thread Mike Burns
On Mon, Apr 21, 2008 at 6:16 PM, Clarke Echols <[EMAIL PROTECTED]> wrote: > If what you are picking up as user input contains text with a line > starting with ".", insert "\&" in front of it. That places a > zero-width space at the start of the line and puts the dot in > third place on the line s

Re: [Groff] Trying to escape user input.

2008-04-21 Thread Keith Marshall
On Tuesday 22 April 2008 01:05, Mike Burns wrote: > Looking at the man pages I thought I could just change all "." after > a newline to "\.", and that would escape it, but this doesn't seem to > work.  I created a tiny 2-line roff input program to show my problem. > > foo.t-

Re: [Groff] Trying to escape user input.

2008-04-21 Thread Clarke Echols
If what you are picking up as user input contains text with a line starting with ".", insert "\&" in front of it. That places a zero-width space at the start of the line and puts the dot in third place on the line so it gets ignored as a command. Thus a line starting with ".rt" becomes "\&.rt".

[Groff] Trying to escape user input.

2008-04-21 Thread Mike Burns
I'm working on a document that will have certain sections replaced with user input, and I'd like to make sure that the user input doesn't execute any roff code. I'm having trouble figuring out how to escape a "." after a newline. Looking at the man pages I thought I could just change all "." aft