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

Ability to adding HTML tag/element instead of spaces around English words #182

Open
thomjiji opened this issue Feb 27, 2024 · 0 comments
Open

Comments

@thomjiji
Copy link

thomjiji commented Feb 27, 2024

Is it possible for autocorrect to configurate to add others characters or HTML tag/element instead of adding spaces automatically?

I found that in epub's HTML document, simply adding spaces around English words and numbers may not be the most optimal way to handle it. And I found this in the W3C's draft "Requirements for Chinese Text Layout":

In principle, there is tracking or spacing between an adjacent Han character and a Western character of up to 1/4 em, except at the line start or end.

So in terms of epub, the solution I'm thinking of is adding an HTML tag/element around the English or numbers when mixing English words/numbers and Chinese characters, and then add that spacing using CSS. For example:

  1. Adding HTML element around numbers (or English words/characters):
“菲亚特<span class="margin_add_left">1100</span>”靠了过来
尼诺是<span class="margin_add_both">A</span>班的学生
比如说,<span class="margin_add_right">A</span>班的
  1. Styling it using CSS to add space around them.
.margin_add_both {
    margin-left: 0.25em;
    margin-right: 0.25em;
}

.margin_add_left {
    margin-left: 0.25em;
}

.margin_add_right {
    margin-right: 0.25em;
}

I've found autocorrect to be great for dealing with English and Chinese typesetting in the web or document world, but simply adding spaces may not be enough when dealing with epub documents that need to be imported into some ebook readers such as the Kindle for reading. So I would like to know if it is possible for the user to configure it to automatically add HTML tag around English words and numbers instead of just spaces. Thanks! 🌟

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

No branches or pull requests

1 participant