Skip to content

Commit f6eb4a3

Browse files
committed
Release 1.0.2
### Added - Add line break support - Add simple HTML sanitization to JS
1 parent 94ff920 commit f6eb4a3

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ vendor
2828
node_modules
2929
hot
3030
mix-manifest.json
31-
/.idea
31+
/.idea

.idea/Notes for Craft CMS.iml

Lines changed: 0 additions & 9 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.2 - 2020-10-29
2+
### Added
3+
- Add line break support
4+
- Add simple HTML sanitization to JS
5+
16
## 1.0.1 - 2020-10-16
27
- Update license
38

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ether/notes",
33
"description": "A note taking field type for Craft CMS 3",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"type": "craft-plugin",
66
"license": "proprietary",
77
"minimum-stability": "dev",

src/templates/field.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{% for note in notes %}
1919
<li>
2020
<div>
21-
<p>{{ note.note }}</p>
21+
<p>{{ note.note|nl2br }}</p>
2222
<small>{{ note.author }} &bull; {{ note.date }}</small>
2323
</div>
2424
{% if allowDeleting %}

src/web/notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function NotesField ([ns, siteId, elementId, userId, allowDeleting]) {
1717
, p = document.createElement('p')
1818
, s = document.createElement('small')
1919
, a = document.createElement('a');
20-
p.textContent = note;
20+
p.innerHTML = note.replace(/</g, '&lt;').replace(/\n/g, '<br/>');
2121
s.innerHTML = data.meta;
2222
d.appendChild(p);
2323
d.appendChild(s);

0 commit comments

Comments
 (0)