CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-sindresorhus--slugify

Slugify a string with comprehensive Unicode transliteration and extensive customization options

94

1.34x
Overview
Eval results
Files

task.mdevals/scenario-7/

Social Media Post Sanitizer

Build a utility that sanitizes social media post titles for use in URLs and filenames. The utility should handle special characters and symbols commonly used in social media content and convert them into URL-friendly formats.

Capabilities

Title Sanitization

Convert social media post titles into clean, URL-friendly slugs that are safe for use in web addresses and filesystem paths.

  • Given the title "Tech News & Updates", return "tech-news-and-updates" @test
  • Given the title "We ♥ Open Source!", return "we-love-open-source" @test
  • Given the title "Amazing 🦄 Product Launch", return "amazing-unicorn-product-launch" @test
  • Given the title "AI & Machine Learning ♥ 🦄", return "ai-and-machine-learning-love-unicorn" @test

Implementation

@generates

API

/**
 * Sanitizes a social media post title into a URL-friendly slug.
 * Handles special characters and converts them to readable text equivalents.
 *
 * @param {string} title - The post title to sanitize
 * @returns {string} The sanitized slug
 */
function sanitizeTitle(title) {
  // IMPLEMENTATION HERE
}

module.exports = { sanitizeTitle };

Dependencies { .dependencies }

@sindresorhus/slugify { .dependency }

Provides string slugification with built-in character replacement support.

Install with Tessl CLI

npx tessl i tessl/npm-sindresorhus--slugify

tile.json