Smart Symbols
Automatically converts (TM) to โข, (R) to ยฎ, and (C) to ยฉ with proper positioning
Smart, accessible typography enhancements for your Nuxt applications with full SSR/SSG support
Nuxt SmartScript is a powerful Nuxt module that automatically transforms typography patterns in your content to enhance readability and visual appeal. It works seamlessly with your existing Nuxt application, requiring minimal configuration.
Web content often contains patterns like (TM), (R), chemical formulas (H2O), and ordinal numbers (1st, 2nd) that could be displayed more professionally with proper typography.
SmartScript automatically detects and transforms these patterns into beautifully formatted typography with proper superscripts, subscripts, and symbols - all while maintaining accessibility.
Input:
Your Product(TM) is the 1st choice for quality!
H2O and CO2 are common molecules.
E=mc^2 is Einstein's famous equation.
Output:
Install the module to your Nuxt application with one command:
npm install @mitre/nuxt-smartscript
pnpm add @mitre/nuxt-smartscript
yarn add @mitre/nuxt-smartscript
Add it to your nuxt.config.ts
:
export default defineNuxtConfig({
modules: ['@mitre/nuxt-smartscript'],
// Optional: customize the behavior
smartscript: {
// Enable/disable specific transformations
transformations: {
trademark: true, // (TM) โ โข
registered: true, // (R) โ ยฎ
copyright: true, // (C) โ ยฉ
ordinals: true, // 1st โ 1หขแต
chemicals: true, // H2O โ HโO
mathSuper: true, // x^2 โ xยฒ
mathSub: true, // x_1 โ xโ
},
// Full SSR/SSG support
ssr: true,
client: true,
}
})
That's it! SmartScript will automatically enhance your typography across 30+ HTML elements.
Apache 2.0 - ยฉ 2025 MITRE Corporation