UNPKG

@jverneaut/html-to-gutenberg

Version:

Create custom Gutenberg blocks from the HTML templates you already have.

7 lines (6 loc) 262 B
// Converts a kebab-case string to Title Case // e.g., "hello-world" -> "Hello World" export default (str) => str .replace(/-/g, " ") // Replace hyphens with spaces .replace(/\b\w/g, (c) => c.toUpperCase()); // Capitalize the first letter of each word