Initializing...
function strikeThrough(value: string) { let i = 0; while (i < value.length && (value[i] === ' ' || value[i] === '\t')) { i++; } const indent = value.slice(0, i); const text = value.slice(i); if (!text) return indent; return `${indent}<s>${text}</s>`; } strikeThrough(" <b>aaa</b>");
function strikeThrough(value: string) { const text = value.trimLeft(); if (!text) return value; const indent = value.slice(0,value.length-text.length); return `${indent}<s>${text}</s>`; } strikeThrough(" <b>aaa</b>");
function strikeThrough(value: string) { const m=/^(\s*)(.*)$/s.exec(value); if (!m[2]) return m[1]; return `${m[1]}<s>${m[2]}</s>`; } strikeThrough(" <b>aaa</b>");
You can edit these tests or add more tests to this page by appending /edit to the URL.