fix asciidoc korean issue (progit#47) #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ascdoc 한글 이슈(#47)에도 언급하신 백틱으로 감싸진 코드 블록 뒤에 특수문자가 아닌 문자가 오면 제대로 변환하지 못하는 문제를 백틱과 문자 사이에 공백을 넣는 것으로 고쳤습니다.
수정에 사용된 명령어는 다음과 같습니다.
find . -type f -name "*.asc" -exec ruby -pi -e 'gsub(/(`[^`]*?`) ?(.)/){|e| s = $1 + " " + $2; $2 =~ /(?u)\w/ ? s : e}' {} +
백틱 두 개 사이에 문자가 들어간 항목들(코드 블록으로 변환될 부분) 바로 뒤에 특수문자가 아닌 문자가 올 경우 공백을 넣어주는 코드입니다.
(조건문이 들어가야 해서 sed나 perl의 정규식만으로는 해결이 안 돼서 루비를 활용을 하다 보니... 가독성이 매우 나빠진 점은 양해 부탁드립니다.)
5384e8b 는 코드 블록 정상화를 하다 보니 이전에는 html 태그로 변환이 되지 않아서 보이지 않았던 특수문자 이스케이프 관련 문제를 해결하려고 만든 커밋입니다.
3-maintaining.asc
파일은 원문과 같이 수정하였고,2-contributing.asc
파일은 원문과 같이 앞뒤로 +를 넣는 것으로 수정해 보았는데 마찬가지로 오류가 발생하여서 백슬래시로 이스케이핑 하는 것으로 해결하였습니다.로컬 빌드 확인하였고, 아래는 빌드 결과 비교 항목 예시입니다.
참고로 #133 에도 언급한 것 처럼 현재 바뀐 링크때문에 빌드가 안되는 현상도 있기 때문에 해당 커밋까지 포함해서 확인한 결과입니다.