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 html code tags for ko&en #1879

Closed
wants to merge 1 commit into from
Closed

Conversation

hanu9257
Copy link

Changes

Fix the broken html code tags for Korean and English in book about refspec.

Language Before After
English image image
Korean image image

Context

I was reading the section about refspec and realize that it's <code></code> tag was little bit broken in English
and also found the same issue in Korean books. I think it will be more comfortable to read after the changes in both languages. 😄

Comment on lines -41 to +42
<p>The format of the refspec is, first, an optional <code>`, followed by `&lt;src&gt;:&lt;dst&gt;`, where `&lt;src&gt;` is the pattern for references on the remote side and `&lt;dst&gt;` is where those references will be tracked locally.
The `</code> tells Git to update the reference even if it isn’t a fast-forward.</p>
<p>The format of the refspec is, first, an optional <code>`</code>, followed by <code>&lt;src&gt;:&lt;dst&gt;</code>, where <code>&lt;src&gt;</code> is the pattern for references on the remote side and <code>&lt;dst&gt;</code> is where those references will be tracked locally.
The <code>`</code> tells Git to update the reference even if it isn’t a fast-forward.</p>
Copy link
Member

Choose a reason for hiding this comment

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

As per

### DO NOT EDIT! Generated by script/update-book2.rb
, please do not edit this file directly.

Seeing that the source is correct, we need to figure out why it is not rendered correctly instead.

The script that does the rendering code is located here: https://github.com/git/git-scm.com/blob/HEAD/script/update-book2.rb. I'll have a go at figuring out what is going on here, and circle back.

Copy link
Member

Choose a reason for hiding this comment

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

@hanu9257 I figured it out: It is a regression in AsciiDoctor (I've reported it here). Previously, the ProGit book was rendered using AsciiDoctor v2.0.16, now it uses v2.0.23 (the latter having that bug).

How about resolving it like this?

diff --git a/script/update-book2.rb b/script/update-book2.rb
index 36baea4b5..a25aca5f1 100644
--- a/script/update-book2.rb
+++ b/script/update-book2.rb
@@ -74,6 +74,9 @@ def genbook(language_code, &get_content)
   content = expand(initial_content, "progit.asc") { |filename| get_content.call(filename) }
   # revert internal links decorations for ebooks
   content.gsub!(/<<.*?\#(.*?)>>/, "<<\\1>>")
+  # work around AsciiDoctor v2.0.19 and later mis-interpreting multiple `+` as
+  # indicating the start or the end of literal monospace.
+  content.gsub!(/`\+`/, "`{plus}`")
 
   asciidoc = Asciidoctor::Document.new(content, attributes: { "lang" => language_code })
   html = asciidoc.render

dscho added a commit to dscho/git-scm.com that referenced this pull request Sep 26, 2024
In git#1879 a regression was
reported in the way the explanation of the refspec format is rendered;
It is now broken.

The reason is a regression in AsciiDoctor (reported at
asciidoctor/asciidoctor#4624).

As a work-around, replace the `+` instances (which are mis-interpreted
if more than one exists in the same line) by `{plus}` (which AsciiDoctor
renders exactly like AsciiDoc would).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git-scm.com that referenced this pull request Sep 26, 2024
In git#1879 it was reported that at
least the English and Korean version of chapter 10 section 5 displayed a
regression where the explanation of the refspec format was formatted
incorrectly.

Turns out that this is a regression in AsciiDoctor v2.0.19. We just
adjusted the `update-book2.rb` script to work around this issue, and now
it is time to commit the result of re-running that script for all
variants of the ProGit book.

This commit is best viewed with `--word-diff`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git-scm.com that referenced this pull request Sep 26, 2024
In git#1879 a regression was
reported in the way the explanation of the refspec format is rendered;
It is now broken.

The reason is a regression in AsciiDoctor (reported at
asciidoctor/asciidoctor#4624).

As a work-around, replace the `+` instances (which are mis-interpreted
if more than one exists in the same line) by `{plus}` (which AsciiDoctor
renders exactly like AsciiDoc would).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git-scm.com that referenced this pull request Sep 26, 2024
In git#1879 it was reported that at
least the English and Korean version of chapter 10 section 5 displayed a
regression where the explanation of the refspec format was formatted
incorrectly.

Turns out that this is a regression in AsciiDoctor v2.0.19. We just
adjusted the `update-book2.rb` script to work around this issue, and now
it is time to commit the result of re-running that script for all
variants of the ProGit book.

This commit is best viewed with `--word-diff`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented Sep 26, 2024

Superseded by #1880.

@dscho dscho closed this Sep 26, 2024
@dscho
Copy link
Member

dscho commented Sep 26, 2024

@hanu9257 thank you for contributing this change! Even though this PR did not get merged, it provided valuable and complete information that helped fix this regression swiftly. ❤️

@hanu9257
Copy link
Author

Thanks about your comments that helped me learn about this repo more! Maybe next time I could make more valuable PR! Appreciate your work! 😉

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.

2 participants