~sircmpwn/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH scdoc] Suppress sentence spacing after end-of-sentence characters.

Details
Message ID
<20200813134408.2274496-1-o@krj.st>
DKIM signature
missing
Download raw message
Patch: +18 -2
This should fix the inconsistent spacing issue mentioned in [1]. I also
fixed a spacing in issue in the man page.

[1]: https://lists.sr.ht/~sircmpwn/public-inbox/%3CC4VKFSIFINOA.X6VCIU2AV88M%40szk%3E
---
 scdoc.5.scd      | 2 +-
 src/main.c       | 9 ++++++++-
 test/line-breaks | 9 +++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/scdoc.5.scd b/scdoc.5.scd
index f4d393b..b548b81 100644
--- a/scdoc.5.scd
+++ b/scdoc.5.scd
@@ -120,7 +120,7 @@ To begin a table, add an empty line followed by any number of rows.
Each line of a table should start with | or : to start a new row or column
respectively (or space to continue the previous cell on multiple lines),
followed by [ or - or ] to align the contents to the left, center, or right,
followed by a space and the contents of that cell.  You may use a space instead
followed by a space and the contents of that cell. You may use a space instead
of an alignment specifier to inherit the alignment of the same column in the
previous row.

diff --git a/src/main.c b/src/main.c
index 7bb6c42..8c5ffeb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -241,10 +241,17 @@ static void parse_text(struct parser *p) {
		case '.':
			if (!i) {
				// Escape . if it's the first character
				fprintf(p->output, "\\&.");
				fprintf(p->output, "\\&.\\&");
				break;
			}
			/* fallthrough */
		case '!':
		case '?':
			last = ch;
			utf8_fputch(p->output, ch);
			// Suppress sentence spacing
			fprintf(p->output, "\\&");
			break;
		default:
			last = ch;
			utf8_fputch(p->output, ch);
diff --git a/test/line-breaks b/test/line-breaks
index c119bd9..83dc703 100755
--- a/test/line-breaks
+++ b/test/line-breaks
@@ -44,3 +44,12 @@ hello++
_world_
EOF
end 0

begin "Suppresses sentence spacing"
scdoc <<EOF | grep 'hel!\\&lo.\\&' >/dev/null
test(8)

hel!lo.
world.
EOF
end 0
--
2.28.0

[scdoc/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<C4VWX7OOQNAY.MUKBV13XFW0R@cirno>
In-Reply-To
<20200813134408.2274496-1-o@krj.st> (view parent)
DKIM signature
missing
Download raw message
scdoc/patches/.build.yml: SUCCESS in 13s

[Suppress sentence spacing after end-of-sentence characters.][0] from [kst][1]

[0]: https://lists.sr.ht/~sircmpwn/public-inbox/patches/11946
[1]: o@krj.st

✓ #279079 SUCCESS scdoc/patches/.build.yml https://builds.sr.ht/~sircmpwn/job/279079
Details
Message ID
<C4WT6B5SGLGN.1E9DR7KDOF2BB@homura>
In-Reply-To
<20200813134408.2274496-1-o@krj.st> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/scdoc
   1645e3c..97106f1  master -> master
Reply to thread Export thread (mbox)