Poor man’s italic/bold

Bold/italic in normal <input>/<textarea> elements

作者
Kugland
日安装量
0
总安装量
6
评分
0 0 0
版本
1.0.7
创建于
2022-10-21
更新于
2023-10-21
大小
2.6 KB
许可证
MIT
适用于
所有网站

Poor man’s italic/bold

Greasy Fork镜像 Version Greasy Fork镜像 Rating Greasy Fork镜像 License

This script allows you to use italic (actually 𝘪𝘵𝘢𝘭𝘪𝘤) and bold (𝗯𝗼𝗹𝗱) inside normal <input> and <textarea> elements.

GitHub page: https://github.com/kugland/poor-mans-italic-bold

Greasy Fork镜像 page: https://gf.qytechs.cn/scripts/453505-poor-man-s-italic-bold

Detailed description

The script uses characters in the Unicode block Mathematical Alphanumeric Symbols (U+1D400–U+1D7FF), which is not supported by most fonts. 𝘚𝘰 𝘵𝘩𝘦 𝘵𝘦𝘹𝘵 𝘮𝘪𝘨𝘩𝘵 𝘴𝘩𝘰𝘸 𝘪𝘯 𝘢 𝘥𝘪𝘧𝘧𝘦𝘳𝘦𝘯𝘵 𝘧𝘰𝘯𝘵, 𝗼𝗿 𝗻𝗼𝘁 𝗮𝘁 𝗮𝗹𝗹.

Usage

Just select the text inside a <input> or <textarea> and click Ctrl+I for italic or Ctrl+B for bold.

Notes

  • Only alphabetic characters are supported. Anything outside the Latin alphabet (any non-Latin script, punctuation, symbols, numbers &c) won’t be changed at all.

  • Accented characters will be replaced with the appropriate italic and/or bold character plus the combining character for the diacritic.

For example:

  é       U+00E9      LATIN SMALL LETTER E WITH ACUTE

will be italicized as

  𝘦       U+1D626     MATHEMATICAL SANS-SERIF ITALIC SMALL E
  ◌́       U+0301    COMBINING ACUTE ACCENT
  • Many web apps use normal <div> elements with contenteditable="true", instead of <input>/<textarea> elements. This script won’t work with those either. Also this script won’t play nicely with controlled components in React or other similar frameworks.

Credits

Written by André Kugland.

Inspired by https://yaytext.com/bold-italic/.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址