New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an extension to handle Chinese (or CJK) newlines. #334

merged 3 commits into from Apr 13, 2017


None yet
2 participants

choueric commented Feb 22, 2017

There is a common discussion, for example here, about the difference between English and Chinese when there are linebreaks in a paragraph. Here is a method by adding a extension to join lines.


This comment has been minimized.


rtfb commented Mar 16, 2017

Sorry for the delay to get back to you.

First, please rewrite the test to not need the testdata file. I see no reason for that. Also, move the test to block_test.go.

Also, how does this work with consecutive newline characters (and how should it)? I see from the test that it doesn't join all the input into a single line, but can't immediately see why.

modify testcase of joinLine.
1. delete testdata 'zhJoinLines.txt'.
2. move the testcase from markdown_test.go into block_test.go.

This comment has been minimized.


choueric commented Mar 17, 2017

Thanks for your suggestion and I did the modifications.

About the newline, there are actually two paragraphes in the testdata, one is:


and the other is:


So it should generate two lines:




Consecutive newline characters, for example two newlines, are used to separate two paragraphes and should not generate just one line (i.e. one paragraph).

If I don't get your idea, please forgive me. Or you can give me an example to illustrate.


This comment has been minimized.


rtfb commented Apr 13, 2017

Thanks, @choueric!

@rtfb rtfb merged commit b253417 into russross:master Apr 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

anthonyfok added a commit to gohugoio/hugo that referenced this pull request Jun 27, 2017

helpers: Add Blackfriday 'joinLines' extension support (#3574)
See russross/blackfriday#334
"add an extension to handle Chinese (or CJK) newlines"
for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment