Skip to content

Commit 7a50254

Browse files
authored
Merge pull request ExpressionEngine#694 from swierczek/feature/channel-settings
Add Typography > HTML Formatting options
2 parents 0f0ec11 + a05249c commit 7a50254

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

AUTHORS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ If an entry is incorrect or duplicated, add or correct the entry in `.mailmap` i
1717
- Derek Jones <derek.jones@ellislab.com>
1818
- Doug Black Jr <dougblackjr@gmail.com>
1919
- Douglas Black <dougblackjr@gmail.com>
20+
- Eric Swierczek <2423727+swierczek@users.noreply.github.com>
2021
- Erwin Romkes <hello@stoneandstorm.com>
2122
- Gareth Davies <hello@garethtdavies.com>
2223
- Gavin * JCOGS <gavin@jcogs.net>
@@ -54,7 +55,7 @@ If an entry is incorrect or duplicated, add or correct the entry in `.mailmap` i
5455
- Simon Job <simon@job.id.au>
5556
- Stefan Rechsteiner <info@stefanrechsteiner.com>
5657
- Stephen G <45797159+stephengalbraith@users.noreply.github.com>
57-
- Stephen G <45797159+zdravvy@users.noreply.github.com>
58+
- zdravvy <45797159+zdravvy@users.noreply.github.com>
5859
- Terry Leigh Britton <terrybritton@users.noreply.github.com>
5960
- Tom Jaeger <Tom@PacketTide.com>
6061
- TomJaeger <Tom@PacketTide.com>

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The ExpressionEngine user guide is written in human-readable Markdown and uses a
88

99
### Prerequisites
1010

11-
Building the docs requires Node and npm.
11+
Building the docs requires Node and npm (latest stable version).
1212

1313
In the root of the repository, install all the dependencies:
1414

@@ -30,6 +30,10 @@ The documentation css and js files are located under `theme/assets-src`.
3030

3131
To build the theme assets, run `npm run buildAssets`. You can also dynamically rebuild the assets when a file changes: `npm run watchAssets`.
3232

33+
### Viewing local changes
34+
35+
Manually load `/build/index.html` in your browser to view your local build. For example, `file:///Users/<username>/Documents/ExpressionEngine-User-Guide/build/index.html`. You can use the side navigation to navigate to different local files, but the search functionality always takes you to the live version at docs.expressionengine.com.
36+
3337
## Contributing
3438

3539
See something that needs fixing? Want to improve the user guide or make it more helpful? Great! Check out [CONTRIBUTING.md](CONTRIBUTING.md) for details.

docs/control-panel/channels.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ NOTE: **Note:** We recommend using the default base URL variable `{base_url}` de
121121
- **Maximum characters allowed?** -- You may set a maximum number of characters allowed in any comment. Setting this preference to 0 (zero) will not place a restriction on the number of characters allowed.
122122
- **Comment time limit** -- This is the optional number of seconds that must lapse after a comment is posted before that same user can post another comment. This setting can help reduce comment "spam". The preference can be left blank or set to 0 (zero) if you do not want to impose a limit.
123123
- **Comment expiration** -- The number of days after an entry is posted in which to allow comments. After that period has expired, the entry will be closed to commenting and the comment form will no longer appear. Existing comments will still be displayed. Enter 0 (zero) for no expiration. Note that this preference sets the _default_ setting for the channel. The setting can be overridden and changed on a per-entry basis. You may override this setting in the [Comment Module Control Panel](comment/control-panel.md) section of the Comment Module so that comments are set to be moderated rather than closed once the expiration period is passed. If you also select the checkbox accompanying this setting, then all existing entries in this channel will be updated to reflect the new setting when you submit.
124-
- **Text formatting** -- This setting determines how comments are formatted by the system. There are three possible choices:
124+
- **Text formatting** -- This setting determines how comments are formatted by the system. There are three possible choices: `Auto line break`, `None`, and `XHTML`
125125
- **HTML formatting** -- Like the channel setting, this preference determines how raw HTML code within comments is handled. There are three options:
126+
1. Convert to HTML entities -- This will convert any HTML tags to their encoded versions and output the HTML tag as text without rendering the HTML in the DOM. For example: `<h1>` would become `&lt;h1&gt;`.
127+
2. Allow only safe HTML -- This will remove any unsafe HTML tags as defined in the [Typography library](development/legacy/libraries/typography.md#html_format).
128+
3. Allow all HTML (not recommended) -- This will allow any HTML to be saved and output as-is. For example: `<h1>test</h1>` would actually render an `h1` in the DOM.
126129
- **Allow image URLs?** -- You can determine whether or not you want people to be able to display images within comments by using the URL for the image.
127130
- **Render URLs and Email addresses as links?** -- When this option is set to "Yes", any full URLs or email addresses in comments will be automatically formatted as a valid HTML link to the address. If the option is "No" then the URL or email address in comment body will be treated and displayed as plain text.
128131

docs/development/legacy/libraries/typography.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ The Typography class has a number of class properties that you may wish to set b
9898

9999
(`string`) \[ **safe** / all / none \] — Controls how HTML is handled in text.
100100

101+
- `"safe"` -- Allows the following HTML tags to be rendered in the DOM: `h2`, `h3`, `h4`, `h5`, `h6`, `abbr`, `b`, `blockquote`, `cite`, `code`, `del`, `em`, `i`, `ins`, `mark`, `pre`, `span`, `strong`, `sub`, `sup`. All other HTML tags are removed from the content.
102+
- `"all"` -- Allows all HTML tags to be rendered in the DOM. This is not recommended because it may allow users (who may not otherwise have access to edit templates) to inject HTML in unexpected places. For example, if the template is defined as `<p>{content}</p>`, but `{content}` itself is `<form><input></form>`, that will be rendered in the DOM as `<p><form><input></form></p>` which would essentially allow a user to add a form to a page via a `content` field that was probably not intended to be used in this way.
103+
- `"none"` -- Converts all HTML tags to their encoded values (e.g. `<h1>` becomes `&lt;h1&gt;`) and will output it as text. This is the safest option because it prevents any unexpected HTML from being rendered in the DOM.
104+
101105
### `$parse_images`
102106

103107
(`bool`) \[ **TRUE** / FALSE \] — Whether or not `{file:XX:url}` and `{filedir_#}` variables are to be parsed.
@@ -203,7 +207,7 @@ This method encodes email addresses with Javascript, to assist in prevention of
203207

204208
If you want to return a human readable "encoded" email address instead, you can also set the `Typography::$encode_type` class property to `"noscript"`.
205209

206-
## Auto (XTHML) Typography
210+
## Auto (XHTML) Typography
207211

208212
### `auto_typography($str[, $reduce_linebreaks = FALSE])`
209213

0 commit comments

Comments
 (0)