asianbreak-html

Automatically strip breaklines from HTML for east asian people, based on new CSS3 spec of white-space property.

Usage no npm install needed!

<script type="module">
  import asianbreakHtml from 'https://cdn.skypack.dev/asianbreak-html';
</script>

README

AsianBreak-html

Automatically strip breaklines from HTML for east asian people, based on new CSS3 spec of white-space property.

npm status

Build Status Dependency Status npm version LICENSE Greenkeeper badge

const Asianbreak = require('asianbreak-html');
const asianbreak = Asianbreak();

asianbreak.pipe(process.stdout);

asianbreak.end(`
    <blockquote>

        婆さんは先刻から暦の話をしきりに為していた。
        <em>みずのえ</em>だの<em>かのと</em>だの、
        八朔だの友引だの、爪を切る日だの普請をする日だのと
        頗る煩いものであった。

        <cite style="
            font-size: 0.8em;
        ">夏目漱石『それから』</cite>

    </blockquote>
`);

output:

<blockquote>

    婆さんは先刻から暦の話をしきりに為していた。<em>みずのえ</em>だの<em>かのと</em>だの、八朔だの友引だの、爪を切る日だの普請をする日だのと頗る煩いものであった。<cite style="
        font-size: 0.8em;
    ">夏目漱石『それから』</cite>

</blockquote>

Background

TODO: write

API

This module exposes single class Asianbreak, which allows you to use your normal stream Transforming API.

Processed HTML is emitted when it is ready even in partial form so it is "streaming." :smiley:

constructor: Asianbreak([options])

  • options: unimplemented

Create new AsianBreak transforming instance. new can be omitted.