$ emacs file.html
We have one long line, with no ASCII whitespace to break on.
Before:
weeklyOSM 的想法是蒐集來自世界各地,與 OSM 相關的新聞,處理這些新聞並將其翻譯成盡可能多種語言。這應該有助於讓社群知道所有消息並克服語言障礙。
Do M-q (fill-paragraph)
, getting:
After:
weeklyOSM 的想法是蒐集來自世界各地,與 OSM 相關的新聞,處理這些新聞並
將其翻譯成盡可能多種語言。這應該有助於讓社群知道所有消息並克服語言障礙。
But I want it to break only after punctuation (,
, 。
) or whitespace
So what's the big deal about a newline injected between your Chinese characters?
The newlines become unsightly spaces when the HTML is rendered.
Well then just post-process it to get the newlines back out.
What a hassle.
So how would you like it broken?
weeklyOSM 的想法是蒐集來自世界各地,
與 OSM 相關的新聞,
處理這些新聞並將其翻譯成盡可能多種語言。
這應該有助於讓社群知道所有消息並克服語言障礙。
Well then just substitute newlines after each punctuation,
s/,|。/$&\n/g
in Perl.
Yes, but M-q
will still break my longer stretches.
Well then don't use
M-q
.
But can't I just set some variable that would allow me to live a normal life, like my ASCII using friends do?
I mean great, some people think it is cool to add newlines (which I say are just as bad as spaces) between Chinese characters. Well how do I opt-out?
fill-paragraph-function
to it?