Skip to content

Commit

Permalink
Release 1.0.2
Browse files Browse the repository at this point in the history
### Added
- Add line break support
- Add simple HTML sanitization to JS
  • Loading branch information
Tam committed Oct 29, 2020
1 parent 94ff920 commit f6eb4a3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ vendor
node_modules
hot
mix-manifest.json
/.idea
/.idea
9 changes: 0 additions & 9 deletions .idea/Notes for Craft CMS.iml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.2 - 2020-10-29
### Added
- Add line break support
- Add simple HTML sanitization to JS

## 1.0.1 - 2020-10-16
- Update license

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/notes",
"description": "A note taking field type for Craft CMS 3",
"version": "1.0.1",
"version": "1.0.2",
"type": "craft-plugin",
"license": "proprietary",
"minimum-stability": "dev",
Expand Down
2 changes: 1 addition & 1 deletion src/templates/field.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% for note in notes %}
<li>
<div>
<p>{{ note.note }}</p>
<p>{{ note.note|nl2br }}</p>
<small>{{ note.author }} &bull; {{ note.date }}</small>
</div>
{% if allowDeleting %}
Expand Down
2 changes: 1 addition & 1 deletion src/web/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function NotesField ([ns, siteId, elementId, userId, allowDeleting]) {
, p = document.createElement('p')
, s = document.createElement('small')
, a = document.createElement('a');
p.textContent = note;
p.innerHTML = note.replace(/</g, '&lt;').replace(/\n/g, '<br/>');
s.innerHTML = data.meta;
d.appendChild(p);
d.appendChild(s);
Expand Down

0 comments on commit f6eb4a3

Please sign in to comment.