{"id":18300328,"url":"https://github.com/jpdevries/wool","last_synced_at":"2025-10-18T09:26:36.398Z","repository":{"id":24901514,"uuid":"28318064","full_name":"jpdevries/wool","owner":"jpdevries","description":"Typographic crime-stopping snippet for MODX 2.x.","archived":false,"fork":false,"pushed_at":"2016-06-23T11:44:02.000Z","size":24,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2024-11-22T01:41:58.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpdevries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-22T00:00:41.000Z","updated_at":"2019-09-09T17:15:53.000Z","dependencies_parsed_at":"2022-07-13T22:50:28.972Z","dependency_job_id":null,"html_url":"https://github.com/jpdevries/wool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdevries%2Fwool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdevries%2Fwool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdevries%2Fwool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdevries%2Fwool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpdevries","download_url":"https://codeload.github.com/jpdevries/wool/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227962266,"owners_count":17847912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T15:12:02.313Z","updated_at":"2025-10-18T09:26:31.347Z","avatar_url":"https://github.com/jpdevries.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"wool\n====\n\nWool contains RegEx to combat and rectify all [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit). As if that weren’t enough, Wool is completely free and easy to use\u0026nbsp;anytime.\n\n\u003e “Any man who would letterspace blackletter would shag sheep.” — Frederic Goudy\n\nStop stealing sheep \u0026 make your clients look like they know how type works with this typographic crime-stopping snippet for MODX\u0026nbsp;2.x.\n\n## Installation\nInstall via the MODX\u0026nbsp;Package\u0026nbsp;Manager.\n\n## Overview\nWool helps you keep your client's poor HTML practices from being reflected to the world by identifying and\u0026nbsp;correcting\u0026nbsp;them.\n\nCurrently Wool is capable of bailing your clients out of all [10 HTML entity crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) free of\u0026nbsp;charge.\n\nWool does this by performing clever Regular Expressions on provided `$input` text and returning more typographically correct\u0026nbsp;result.\n\nWhile wool is currently packaged specifically for MODX Revolution, it's written in RegEx meaning it should be fairly portable to other\u0026nbsp;technologies.\n\n## Options\n\nWool can be used as a single `[[wool]]` snippet or granularly as seen in Granular Usage below. The `[[wool]]` snippet supports the below options and can be used with default options as an output\u0026nbsp;modifier:\n```\n[[*introtext:wool]]\n```\n\nor traditionally like\u0026nbsp;so:\n```\n[[wool?\n  \u0026input =`[[*introtext]]`\n  \u0026encodeQuotes=`false`\n]]\n```\n\nName  | Description  | Default Value\n------|--------------|----------------\nadopt | Adopts orphans by replacing the last space in sentences with a non-breaking space. | `true`\nfixEllipsis  | Replaces sloppy ellipsis (...) with `\u0026hellip;` entity | `true`\nencodeQuotes  | Fixes ellipsis | `true`\nfixGreedySpaces  | Fixes ellipsis | `true`\nfixDashes  | Replaces sloppy greedy spaces with `\u0026emsp;` and `\u0026ensp;` entities | `true`\nfixPhonyFractions  | 5 / 6 =\u003e \u003csup\u003e5\u003c/sup\u003e\u0026frasl;\u003csub\u003e6\u003c/sub\u003e | `true`\nfixPhonyMultiplicationSigns  | 5 x 5 =\u003e 5 \u0026times; 5 | `true` \nfixPhonyDivisionSigns  | 5 % 5 =\u003e 5 \u0026divide; 5 | `true`\nfixDegreeSymbols  | Replaces manual degree symbols with `\u0026deg;` entity | `true`\nfixCopyrightSymbols  | Fixes phony copyright symbols | `false`\nfixTrademarkSymbols  | Fixes phony trademark symbols | `false`\nencodeAmpersands  | Encodes the \u0026 character properly. Intended for plain text | `false`\nfixShoutCaps  | Fixes CRAZY CAPS SENTENCES | `false`\nfixCrazyExclamations  | Removes consequtive exclamation points (!!!) | `false`\nfixCrazyQuestionMarks  | Removes consequtive exclamation question marks (???) | `false`\n\n## Granular Usage\n\nWool comes packaged with several easy to use Snippets so you can have your wool in\u0026nbsp;peices.\n\n### Adopt\n\u003e orphan: A word, part of a word, or very short line that appears by itself at the end of a paragraph. Orphans result in too much white space between paragraphs or at the bottom of a page.\n\nEspecially in the world of responsive design, we hook beautiful themes up to content management systems giving clients all the freedom to create every typographic sin there is. Luckily, now with wool we can ensure individual words are never left hanging by their londsome using `[[wool.adopt]]` like\u0026nbsp;so: \n\n```html\n\u003c!-- Assume a long title of “I like fried chicken and beer.” --\u003e\n\u003c!-- Outputs: “I like fried chicken and\u0026nbsp;beer.” --\u003e\n[[*longtitle:wool.adopt]]\n\n\u003c!-- Outputs: “I like fried chicken and beer.” (ommits adoption less than 24 words) --\u003e\n[[wool.adopt?input=`[[*longtitle]]` \u0026minWords=`24`]]\n```\n\n### Copyright\n\nCrime 5 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is the DIY Copyright(c) symbol. Using wool, we combat this like sloppy (c) and replace it with © using `[[wool.copyright]]` like\u0026nbsp;so:\n```html\n\u003c!-- Replaces occurences of “(c)” with “\u0026copy;” --\u003e\n[[*legal:wool.copyright]]\n```\n\n### Crazy Exclamations\n\nWe all have that client WHO LIKES TO WRITE COPY LIKE THIS!!! AND LIKE THIS!!! We can tone that down a bit using `[[wool.crazy-exclamations]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “!!!” with “!”--\u003e\n[[*description:wool.crazy-exclamations]]\n```\n\n### Crazy Question Marks\n\nExcesive question marks can get out of hand. Don't you think so???!!! We can tone that down a bit using `[[wool.crazy-question-marks]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “???!!!” with “?”--\u003e\n[[*description:wool.crazy-question-marks]]\n```\n\n### Degree Symbols\n\nCrime 9 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is using supersized degree symbols. `[[wool.degree-symbol]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “71\u003csup\u003e0\u003c/sup\u003e” with “71°”--\u003e\n[[*weather:wool.degree-symbol]]\n```\n\n### Ellipsis\n\nCrime 2 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is making your own ellipsis. We combat this using `[[wool.ellipsis]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “...” with “\u0026hellip;”. --\u003e\n[[*description:ellipsis]]\n```\n\n### Em \u0026amp; En Dashes\n\nCrime 3 and Crime 4 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is the incorrect use of em and en dashes. We combat this using `[[wool.mdash]]` and `[[wool.ndash]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “--” and “-” with “\u0026mdash;” and “\u0026ndash;” respectively. --\u003e\n[[*description:mdash:ndash]]\n```\n\n### Em \u0026amp; En Spaces\n\nUsing Wool, long run on series of blank spaces can be converted to a single `\u0026emsp;` using `[[wool.emsp]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “          ” with “\u0026emsp;”. --\u003e\n[[*description:emsp]]\n```\n\n### Encode Ampersands\n\nCrime 1 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is to not convert your ampersands. We combat this using `[[wool.encode-ampersands]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “\u0026” with “\u0026amp;”. --\u003e\n[[*pagetitle:wool.encode-ampersands]]\n```\n\n### Mathematics Symbols\n\nCrime 8 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is using plain text mathematics symbols. We combat this using `[[wool.division-signs]]`, `[[wool.multiplication-signs]]` and `[[wool.fractions]]` like\u0026nbsp;so:\n```html\n\u003c!--  Replaces occurences of “1/2” with “\u0026frac12;” --\u003e\n\u003c!--  Replaces occurences of “2/4” or “3 % 6” with “2÷4” and “3 ÷ 6” respectively. --\u003e\n\u003c!--  Replaces occurences of “5*5” with “5×5”. --\u003e\n[[*description:wool.fractions:wool.division-signs:wool.multiplication-signs]]\n```\n\n### Quotations\n\nCrime 10 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is the incorrect use of quotations. We combat this using `[[wool.encode-quotes]]` like so:\n```html\n\u003c!--  Straight to curly quotes. --\u003e\n[[*pagetitle:wool.encode-quotes]]\n```\n\n### Shout Caps\n\nSometimes people shout too much when they type. We combat this using `[[wool.shout-caps]]` like\u0026nbsp;so:\n```html\n\u003c!--  “ALL CAPS” to “All \u003cspan class=\"text-transform\"\u003ecaps\u003c/span\u003e”. --\u003e\n[[*introtext:wool.shout-caps]]\n```\n\n### Trademark\n\nCrime 10 of the [10 HTML crimes you really shouldn't commit](http://line25.com/articles/10-html-entity-crimes-you-really-shouldnt-commit) is to make your own trademark symbols. We combat this using `[[wool.trademark]]` like\u0026nbsp;so:\n```html\n\u003c!--  “\u003csup\u003eTM\u003c/sup\u003e” to “™”. --\u003e\n[[*legal:wool.trademark]]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpdevries%2Fwool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpdevries%2Fwool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpdevries%2Fwool/lists"}