Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/intl/icu/source/i18n/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 7 kB image not shown  

Quelle  sanitize.ts  Sprache: unbekannt

 
import { stripInlineDirectiveTagsForDisplay } from "openclaw/plugin-sdk/text-runtime";

const SPEECH_EMOJI_RE =
  /(?:\p{Extended_Pictographic}(?:\uFE0F|\u200D|\p{Extended_Pictographic}|\p{Emoji_Modifier})*)+/gu;

function escapeRegExp(value: string): string {
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}

function stripEmojiForSpeech(text: string): string {
  return text
    .replace(SPEECH_EMOJI_RE, " ")
    .replace(/\s+([?!.,:;])/g, "$1")
    .replace(/[ \t]{2,}/g, " ")
    .replace(/ *\n */g, "\n")
    .trim();
}

export function sanitizeVoiceReplyTextForSpeech(text: string, speakerLabel?: string): string {
  let cleaned = stripInlineDirectiveTagsForDisplay(text).text.trim();
  if (!cleaned) {
    return "";
  }

  const label = speakerLabel?.trim();
  if (label) {
    const prefix = new RegExp(`^${escapeRegExp(label)}\\s*:\\s*`, "i");
    cleaned = cleaned.replace(prefix, "").trim();
  }

  return stripEmojiForSpeech(cleaned);
}

Messung V0.5 in Prozent
C=98 H=100 G=98

[zur Elbe Produktseite wechseln0.9QuellennavigatorsAnalyse erneut starten2026-09-27]