Skip to content
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
merged 3 commits into from
Apr 13, 2017
Merged

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

merged 3 commits into from
Apr 13, 2017

Conversation

choueric
Copy link
Contributor

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.

@rtfb
Copy link
Collaborator

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.

1. delete testdata 'zhJoinLines.txt'.
2. move the testcase from markdown_test.go into block_test.go.
@choueric
Copy link
Contributor Author

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:

<p>第一行文字。</p>

and

<p>第二行文字。</p>

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.

@rtfb
Copy link
Collaborator

rtfb commented Apr 13, 2017

Thanks, @choueric!

@rtfb rtfb merged commit b253417 into russross:master Apr 13, 2017
@rtfb rtfb mentioned this pull request Apr 13, 2017
4 tasks
anthonyfok pushed a commit to gohugoio/hugo that referenced this pull request Jun 27, 2017
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants