New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cz-typography

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cz-typography

Easily fix Czech typography with JavaScript and React.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

📝 CZ-TYPOGRAPHY

Easily fix Czech typography with JavaScript and React.

Automatically replaces spaces after single-letter conjunctions and prepositions (a, v, s, z...) so they don't stay at the end of the line – in violation of Czech spelling rules!

Developed and maintained by Jan Vyskočil (aka Vysko).

Features

Replace normal spaces with non-breaking spaces (\u00A0):

  • after one-letter prepositions and conjuctions (k autu, v domě)
  • between numbers and units (100 km, 30 °C)
  • between initials and surnames (J. Vyskočil)

Instalation

$ npm install cz-typography
# or
$ yarn add cz-typography

📍 Usage

JavaScript function

import { fixCzech } from "cz-typography"

fixCzech('J. Novák běžel 5 km v domě.');
// => 'J.\u00A0Novák běžel 5\u00A0km v\u00A0domě.'

React component

⚠️ REQUIRES react@16.8.0 or newer
(React is not required if you only use the JS function)

import TypoWrapper from 'cz-typography/react';

<TypoWrapper>
  <p>J. Novák běžel 5 km v domě.</p>
</TypoWrapper>

The recursively walks through all text nodes in the JSX tree and applies the same typographic rules.

✅ Works in Server-side rendering (SSR)
Cannot access nested content inside server components (like layout.js in Next.js) – use it closer to actual content (e.g. in page.js).

Optional configuration

You can disable individual features.
All the features are enabled by default:

fixCzech(text, {
  prepositions: true, // enables fixing one-letter prepositions/conjunctions
  units: true,        // enables fixing number+unit
  initials: true      // enables fixing initial+surname
});

<TypoWrapper options={
  prepositions: true,
  units: true,
  initials: true
}>

Keywords

typography

FAQs

Package last updated on 11 May 2025

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