---
title: Typofilter.js
url: 'https://graker.ru/en/project/typofilter_js'
language: en
type: page
author: 'Roman Grachev'
published: '2016-07-18T15:51:54+03:00'
updated: '2026-10-28T12:33:43+03:00'
translations:
  ru: 'https://graker.ru/project/typofilter_js.md'
---

# Typofilter.js

Long ago, back in 2009, I took the code of [Tipograf](http://rmcreative.ru/blog/post/tipograf) and made an *input filter* for Drupal 6 that puts in nice dashes and quotation marks, packaged it as a module and called it Typofilter. You can read about that old module [here](https://graker.ru/news/2009/06/08/typofilter) (in Russian). Later I decided that instead of automatic typography applied after saving, it's much better to fix typography while you write. So in 2011 I [put together](https://graker.ru/news/2011/02/02/typofilter_js) a JS script for that. The script is now [available on GitHub](https://github.com/graker/typofilter.js).

In 2025 I decided it would be nice to have the same convenience in Obsidian too, and [made an Obsidian plugin](https://graker.ru/news/2025/04/06/obsidian-typofilter).

The script puts in proper (m- and n-width) dashes, guillemet quotes («») and other characters. It's aimed at Russian typography.

#### What the script does

— replaces (c) with ©; 
— replaces (r) with ®; 
— replaces (tm) with ™; 
— replaces multiple dots with an ellipsis; 
— replaces +- with ±; 
— replaces -&gt; with →; 
— replaces &lt;- with ←; 
— fixes quotation marks (uses guillemet quotes «»); 
— replaces hyphens with dashes in text; 
— replaces hyphens with N-width dashes in number ranges; 
— removes spaces between a number and the percent sign.

#### Supported editors

- The Obsidian editor, via the [Obsidian Typofilter](https://github.com/graker/obsidian-typofilter) plugin
- Markdown Editor in [OctoberCMS](http://octobercms.com)
- [CKEditor](http://ckeditor.com/) (partially)
- [TinyMCE](https://www.tinymce.com/) (partially)

The source code and the usage guide are on GitHub: [**https://github.com/graker/typofilter.js**](https://github.com/graker/typofilter.js)

Questions about installing, using or improving the script can be asked here or right on GitHub.
