From 93ccdbbb88ab53730d29dfeca8f0c7e59a4968e5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 16 Sep 2022 17:21:18 +0200 Subject: [PATCH 1/2] roffit: strip italic corrections The `\/` escape sequence inserts an italic correction, i.e. a small piece of horizontal motion (1/12 em) that should be sufficient to separate an italic character from a following roman character. Similarly, `\,`, adds a left italic correction, always a zero motion, that should be sufficient to separate a roman character from an immediately following italic character. roffit now simply removes them Reported-by: hydrargyrum on github Fixes #28 --- roffit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roffit b/roffit index e61ddb2..2e6c08d 100755 --- a/roffit +++ b/roffit @@ -559,6 +559,9 @@ sub parsefile { # \e is the "escape character", defaults to backslash $txt =~ s/\\e/\/g; + # \/ and \, are "italic corrections" that we can just remove + $txt =~ s/\\[,\/]//g; + $txt = handle_italic_bold $txt; # replace backslash [something] with just [something] From 19955b622dcfc19337ef98d37276ea42ec226bda Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 16 Sep 2022 17:40:05 +0200 Subject: [PATCH 2/2] testpage: add test of \, and \/ Based on the #28 report --- testpage.1 | 3 ++- testpage.output | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testpage.1 b/testpage.1 index ec3900a..cbe1322 100644 --- a/testpage.1 +++ b/testpage.1 @@ -5,7 +5,8 @@ .SH NAME testpage \- test input nroff man page for roffit testing .SH SYNOPSIS -.B roffit [options] < inputfile > outputfile +.B roffit +[\fI\,options\/\fR] < inputfile > outputfile .SH DESCRIPTION .B roffit converts the \fIinputfile\fP to \fIoutputfile\fP. The \fIinputfile\fP must be diff --git a/testpage.output b/testpage.output index 943910b..4788cc9 100644 --- a/testpage.output +++ b/testpage.output @@ -2,7 +2,7 @@

Name

testpage - test input nroff man page for roffit testing

Synopsis

-

roffit [options] < inputfile > outputfile

Description

+

roffit [options] < inputfile > outputfile

Description

roffit converts the inputfile to outputfile. The inputfile must be an nroff formatted man page, and the outputfile will be an HTML document.

RFC 959 is FTP

RFC 3986 is URI syntax