Comments (7)
we (sergiodj, samueloph and I) are suspecting the problem is in echo
(which is a built in commad), not actually in sed
. I'll try to do a debug session during the weekend to pinpoint the issue and report upstream. I thought "maybe I should try to report this quick and dirty fix before", but I see it might be a problem to other systems.
from kristall.
This is actually a good question, i think we actually switched from bash
to sh
as it wasn't compatible to other systems. is sed
a shell builtin in dash
?
from kristall.
Ok, I was able to pinpoint the problem:
Double escaping seems to solve it in sh/dash, but it put 2 backslashs in bash. I'm not sure what is the correct/expected behavior in this case.
sh/dash:
$ echo $(echo press *Return* and | sed -E -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\\\fI\2\\\\fR\3#g')
press \fIReturn\fR and
bash:
charles@x1-carbon:~$ echo $(echo press *Return* and | sed -E -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\\\fI\2\\\\fR\3#g')
press \\fIReturn\\fR and
from kristall.
Now I think I've found the answer. sh and, consequently, dash interpret some escaped characters as control sequences, so an echo '\f'
outputs a form feed. bash's echo
defaults to ignore escaped characters unless explicitly told otherwise (-e
flag).
So, my question is: should we double escape \f
to comply with dash? If you agree, I can open a PR with this fix:
diff --git a/doc/gen-man.sh b/doc/gen-man.sh
index 4463c5a..52b5132 100755
--- a/doc/gen-man.sh
+++ b/doc/gen-man.sh
@@ -59,8 +59,8 @@ gem_in=$(
# First expression replaces all [Text like this] with bold text.
# Second expression replaces text like *This* or _this_ with italic text.
sed -E \
- -e 's#\[([^]]*)\]#\\fB\1\\fR#g' \
- -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\fI\2\\fR\3#g'
+ -e 's#\[([^]]*)\]#\\\\fB\1\\\\fR#g' \
+ -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\\\fI\2\\\\fR\3#g'
)
# Convert gemtext to man format
from kristall.
Yeah, can you try make a PR?
from kristall.
Yeah, of course!
from kristall.
I think we can close this issue, right?
from kristall.
Related Issues (20)
- response header edge case
- Bug: "Line is too short for valid protocol" HOT 1
- Support small screens HOT 2
- Icons not visible to the left of the URL bar. HOT 1
- Optimisation for opening large documents.
- qt5-tools needed on Arch Linux
- kristall -v option doesn't have a version when built outside a git repo HOT 3
- Error when clicking on unicode/punycode links
- Apple Mac ARM build? HOT 1
- Ability to center all headers
- CMake support: HOT 1
- Update Search Engines list HOT 1
- Ability to set indentation of the first line of paragraph
- gopher "go to parent" renders parent as raw text - no links | bug | nightly build | osx HOT 2
- Indicate bundled dependencies and their licenses HOT 1
- Add AppData file
- Add install section to CMake file HOT 1
- Default protocol configurable and relative URL mode
- Support subscribing to Gemini feeds
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kristall.