enterplz

0.1.4 • Public • Published

enterplz

Supporting word break for CJK ( Chinese, Japanese, Korean ) in browsers which aren't support CSS property

word-break: keep-all;

( Internet Explorer is only supporting this property currently. )

enterplz is inpired by jquery-word-break-keep-all but there are some of bugs and it can't trail dynamic HTML which is made by Ajax or Websocket. Using MutationObserver, enterplz can track modified HTML and dynamically make word not break by lines enterplz

Usage

Just run like this.

enterplz.run();

And put data-enterplz to any DOM you want.

<div class="title" data-enterplz>
에듀캐스트에서는 누구나 가르칠 수 있고 무엇이든 배울 수 있습니다
</div>

then enterplz find DOM containing data-enterplz and make inner words never wrap to the next line.

Prerequisite

This library is witten in ECMAScript 6 then transpiled to ES5 to be used in browsers ( Chrome, Firefox, Safari, ... ) There aren't many ES6 functions in web browsers, so it should be used with browser polyfill

Example

  • before

image

  • after

image

/enterplz/

    Package Sidebar

    Install

    npm i enterplz

    Weekly Downloads

    4

    Version

    0.1.4

    License

    BSD

    Last publish

    Collaborators

    • momamene