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

feature: add language to body-tag #274

Open
swidbert opened this issue Nov 23, 2023 · 3 comments
Open

feature: add language to body-tag #274

swidbert opened this issue Nov 23, 2023 · 3 comments

Comments

@swidbert
Copy link

swidbert commented Nov 23, 2023

Problem:

To be able to use hyphenation correctly in the German language, the "html" tag requires the "lang" attribute. The "lang" attribute determines which language the element content uses.

Solution:

To do this, simply adjust line 9 in the "get-html.js" file:

<html${config.body_lang ? ` lang="${config.body_lang}"`: ''}>

To activate this in HTML files, this would then be possible by passing the parameter body_lang: 'de' in the options.

@simonhaenisch
Copy link
Owner

Ok sure do you want to create a PR? I won't have time for it any time soon.

  • make the change you suggested in get-html.ts
  • add the option in config.ts into BaseConfig interface and defaultConfig object
  • add it in cli.ts after --body-class as a CLI flag
  • add it in help.ts after --body-class with a description
  • update the readme (usage and options)

@simonhaenisch
Copy link
Owner

BTW the problem with your hyphenation could also just be that you're not saving the file with UTF-8 as file encoding? Have you tried --md-file-encoding flag?

@swidbert
Copy link
Author

swidbert commented Dec 13, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants