I am looking for a way to automatically insert soft hyphens (­ or unicode character) to hyphenate words into HTML document from command line.

1) What is best way to do so from command line?

2) What are options where it comes to using different dictionaries/rules to word hyphenation? Are there rules for languages other than English?

I am aware that some software, including LibreOffice like decribed in Automatic hyphenation software, have option to apply hyphenation to document, but I am looking for way to do so in already existing HTML document without using word processing software.


If what you are looking for is to simply replace - with ­, you could just use sed:

sed -i 's/-/\­/g' file.html

The command above will edit file.html and make the replacement you want.

Your other question is not on topic here so I won't go into any depth but yes, different languages often have different hyphenation rules.

  • Thanks, but question was about using command line tool that will detect hyphenation points and insert them, not simply replacing hyphens to soft hyphens. – Rafal Apr 10 '14 at 10:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.