When I fixed a typo in MDN documentation

2 min

language: ja bn en es hi pt ru zh-cn zh-tw

Hello, I'm Munou.
I was reading MDN documentation to learn a bit more about HTTP.
HTTP | MDN
I found two consecutive periods (..) as a typo.
So, I sent a pull request, and it was merged. Here are my notes from that time.
typo fix : 。。-> 。 & typo fix : 、、-> 、 (#25200) · mdn/translated-content@e398fab · GitHub

Searching Recursively

If there's one incorrect sentence pattern, I assume there are more, with the mindset that if there's one cockroach, there are many.

grep -r "。。"

When I did that, several instances appeared, and after confirming they were all incorrect, I processed them with xargs to apply the fix to all.

grep -rl "。。" | xargs sed -i "s/。。/。/g"

After that, I also found places where '、、' appeared consecutively, so I fixed them as follows.

grep -rl "、、" | xargs sed -i "s/、、/、/g"

Sent a Pull Request and Finished

And so, it was successfully merged.

I'm in the middle of moving, but it was a good way for an idle person to kill time.

Related Posts