New JS Fiddle example, please
FrankConijn opened this issue · 5 comments
This project used to contain a link to a JS Fiddle example. But I don't see it anymore. Can it come back? I don't remember how to install the system on a website and there's no (clear) instruction on how to do that.
Git sei dank nothing is lost. 😄
It was removed with the last commit here: 9f8c7ce#diff-04c6e90faac2675aa89e2176d2eec7d8L16
But the link still works: https://jsfiddle.net/ytiurin/ctwwwL0f/
Thanks, but unfortunately, that Fiddle doesn't work anymore.
Oh, you are right. The original hyphen.js doesn't exist anymore. So it can't work. That's probably the reason why it was removed from the README.
It seems to me that the entire library was changed to be an npm module and can't be used on a HTML page by simply including a script anymore. 😞
So then why does ytiurin reply that he had the HTML tag problem fixed, on #22?
The two things are not related. Ignoring HTML tags in the string you provide to the hyphenation function has nothing to do with how the library can be included in the project or web page.
But I actually missed the file. The hyphen.js file is still there. So it is be possible to use it on a web page too.
There you go: https://jsfiddle.net/g95zu2af/1/
I copied the content of hyphen.js
and patterns/en-gb.js
into the JavaScript code in the Fiddle, because I can't link to the files on Github. But you should be able to use a <script>
tag for that instead.
I changed the example a bit so that it does not alter the page content but shows two alert boxes. First with hyphenating HTML and then ignoring HTML.
I hope this is going to help you out. I agree that the README could be extended with an example as to how to use the library on a normal web page without having to install any module or whatsoever.