
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@ssml-utilities/highlighter
Advanced tools
SSML syntax highlighter for the SSML Utilities toolkit
SSML Highlighter は、Speech Synthesis Markup Language (SSML)のシンタックスハイライトを提供するパッケージです。
npm install @ssml-utilities/highlighter
import { ssmlHighlighter } from "@ssml-utilities/highlighter";
const ssml = "<speak>Hello <emphasis>world</emphasis>!</speak>";
const options = {
classes: {
tag: "ssml-tag",
attribute: "ssml-attribute",
attributeValue: "ssml-attribute-value",
text: "ssml-text",
},
};
const result = ssmlHighlighter.highlight(ssml, options);
if (result.ok) {
console.log(result.value);
}
HighlightOptions
インターフェースで以下のオプションを設定できます:
interface HighlightOptions {
classes: {
tag: string; // タグ要素の CSS クラス名
attribute: string; // 属性名の CSS クラス名
attributeValue: string; // 属性値の CSS クラス名
text: string; // テキストコンテンツの CSS クラス名
};
}
以下のような CSS を適用することで、基本的なハイライトスタイルを設定できます:
.ssml-tag {
color: #000fff;
}
.ssml-attribute {
color: #ffa500;
}
.ssml-attribute-value {
color: #008000;
}
.ssml-text {
color: #000;
}
highlight メソッドはResult
型を返します:
type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
エラーが発生した場合は、ok: false
とerror
メッセージが返されます。
ネストされた SSML のハイライト:
const complexSSML = (
<speak>
{" "}
<prosody rate="slow" pitch="+2st">
{" "}
こんにちは、 <emphasis level="strong">世界</emphasis>!{" "}
</prosody>
</speak>
);
const result = ssmlHighlighter.highlight(complexSSML, options);
MIT ライセンスの下で公開されています。詳細はLICENSEファイルを参照してください。
FAQs
SSML syntax highlighter for the SSML Utilities toolkit
We found that @ssml-utilities/highlighter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.