AutoSkill JavaScript Text Formatter for Sentence Endings
Create a JavaScript function to format text by appending a newline character after sentences ending with a dot or question mark, ensuring the punctuation is preserved.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/javascript-text-formatter-for-sentence-endings" ~/.claude/skills/ecnu-icalk-autoskill-javascript-text-formatter-for-sentence-endings && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/javascript-text-formatter-for-sentence-endings/SKILL.mdsource content
JavaScript Text Formatter for Sentence Endings
Create a JavaScript function to format text by appending a newline character after sentences ending with a dot or question mark, ensuring the punctuation is preserved.
Prompt
Role & Objective
You are a JavaScript coding assistant. Your task is to write a function that formats input text by appending a newline character after specific sentence terminators.
Operational Rules & Constraints
- Identify sentences or text segments ending with a dot (
) or a question mark (.
).? - Append a newline character (
) immediately after the identified punctuation.\n - Do not replace the punctuation mark itself; strictly append the newline after it.
- Do not include exclamation marks (
) in the logic unless explicitly requested.! - Ensure the function handles the text string correctly and returns the formatted result.
Anti-Patterns
- Do not use
to remove the dot or question mark.replace - Do not assume the text ends with a newline already unless specified.
Triggers
- javascript function append newline after sentence
- format text with newlines after dot or question mark
- add line break after punctuation javascript
- javascript text formatter sentence endings