How to hyphenate a string/text in a textarea using jQuery?

醉酒当歌 提交于 2019-12-24 00:49:55

问题


I am not able to hyphenate strings using jQuery. It seems there is no library available. I tried this link but failed. Please help if you know how to hyphenate a string in a textarea according to a textarea's width using a jQuery plugin.


回答1:


I think Hypher is what you're looking for:

https://github.com/bramstein/hypher




回答2:


As of 2016 there is another JavaScript library available that you could use: https://github.com/ytiurin/hyphen

Compared to Hypher, hy-phen is easier to include on your page, since it does not depend on Node.js or jQuery. You simply have to include the JavaScript file for the library and the pattern file for your desired language using a <script> tag.



来源:https://stackoverflow.com/questions/5963915/how-to-hyphenate-a-string-text-in-a-textarea-using-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!