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

Remove redundant line breaks for CJK #587 #588

Closed
wants to merge 1 commit into from
Closed

Remove redundant line breaks for CJK #587 #588

wants to merge 1 commit into from

Conversation

fangyi-zhou
Copy link
Contributor

@fangyi-zhou fangyi-zhou commented Apr 11, 2019

No description provided.

@fangyi-zhou
Copy link
Contributor Author

@fangyi-zhou fangyi-zhou commented Apr 11, 2019

Any idea how do I deal with the test failures?

REDUNDANT_LINE_BREAK_REGEX = /([\p{Han}\p{Hiragana}\p{Katakana}]+)\n([\p{Han}\p{Hiragana}\p{Katakana}]+)/u
def fix_cjk_line_break(str)
while str.match(REDUNDANT_LINE_BREAK_REGEX)
str = str.gsub(REDUNDANT_LINE_BREAK_REGEX, '\1\2')
Copy link
Owner

@gettalong gettalong Apr 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does a simple str.gsub!(REDUNDANT_LINE_BREAK_REGEX, '\1\2') not work?

@gettalong
Copy link
Owner

@gettalong gettalong commented Apr 11, 2019

You need to adapt test/test_files.rb to suppress the tests that cannot be green, like TestFiles#test_test/testcases/cjk-line-break_text_to_latex_compilation.

@fangyi-zhou fangyi-zhou mentioned this pull request Apr 16, 2020
@gettalong gettalong self-assigned this Apr 17, 2020
@gettalong
Copy link
Owner

@gettalong gettalong commented Apr 17, 2020

Thank you - I rebased and merged your changes.

@gettalong gettalong closed this Apr 17, 2020
weirane added a commit to weirane/blog that referenced this issue May 4, 2020
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