rust-cli / rust-cli/roff-rs

Apostrophe in contractions is turned into \*(Aq, subsequently swallowed by pandoc

Open
#38 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
75
Forks
11
Avg merge
2h 25m
Merged PRs (30d)
8

Description

We produce manual pages using roff-rs, then render them as HTML for our web site. I have noticed that apostrophes in contractions and marking of possessive cases area not present in the produced HTML:

$ cat src/main.rs
fn main() {
    let mut r = roff::Roff::new();
    r.text(vec!["I've been a good boy.".into()]);
    println!("{}", r.render());
}
$ cargo run > astropof.1
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/foobr`
$ cat astropof.1
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
I\*(Aqve been a good boy.

$ man ./astropof.1|hd
00000000  49 27 76 65 20 62 65 65  6e 20 61 20 67 6f 6f 64  |I've been a good|
00000010  20 62 6f 79 2e 0a 0a                              | boy...|
00000017
$ pandoc -o astropof.txt astropof.1
$ cat astropof.txt
Ive been a good boy.

Now, I'm not an expert on roff, but one of the manual pages that I consult for advice on writing manual pages says not to use \(aq to escape ordinary apostrophes. https://man7.org/linux/man-pages/man7/groff_man_style.7.html says:

You should not use \(aq for an ordinary apostrophe (as in “can't”)

Through experimentation I discovered that pandoc renders both ' and \(aq just fine.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction in src/main.rs and run cargo run to inspect the generated roff shown in the issue. Compare the output after pandoc conversion with the original contraction. Done means apostrophes in contractions and possessives are preserved in the rendered output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.