New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

asianbreak

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asianbreak

Line Break for East Asian People

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AsianBreak

Line Break for East Asian People

npm status

Build Status Coverage Status Dependency Status npm version LICENSE Greenkeeper badge

const asianbreak = require('asianbreak');

asianbreak(`

     そのとき汽車はだんだん川からはなれて崖の上を通るようになりました。
    向う岸もまた黒いいろの崖が川の岸を下流に下るにしたがってだんだん高くなって行くのでした。
    そしてちらっと大きなとうもろこしの木を見ました。
    その葉はぐるぐるに縮れ葉の下にはもう美しい緑いろの大きな苞が赤い毛を吐いて
    真珠のような実もちらっと見えたのでした。

`);

API

This module exposes single asianbreak(texts[, options]) function.

texts

  • Type: String[] | String

An array of string which supporse to constitute Inline Formatting Context of CSS2.1.

For this example:

<p>
    日本語は、
    <ruby><rb></rb><rb></rb><rp>(</rp><rt>かん</rt><rt></rt><rp>)</rp></ruby>
    を使用する。
</p>

only <p> creates inline formatting context and <rp> and <rt> is supporsed to be removed from inline context tree (in modern browsers), and texts should be:

const texts = ['\n    日本語は、\n    ', '', '漢', '', '字', '', '', '\n    を使用する。\n'];

then you'll get:

const result = asianbreak(texts);
console.log(result); // ['\n    日本語は、', '', '漢', '', '字', '', '', 'を使用する。\n'];

If you restored it to original HTML, it should be:

<p>
    日本語は、<ruby><rb></rb><rb></rb><rp>(</rp><rt>かん</rt><rt></rt><rp>)</rp></ruby>を使用する。
</p>

How great deed is this!

If a string is supplied, it assume that context is constituted by single segment, and returns transformed segment as string.

options

  • Type: Object

Unimplemented

Keywords

FAQs

Package last updated on 23 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc