Split notes into a title + body, with light self-authored markdown
Both NoteSaveForm (create) and the popup's inline Edit form now have a title input (-> properties.name, shown in the black header, same as every other waypoint popup) and a separate body textarea (-> properties.description) for more detail than a single line. New formatNoteBody renders that body with a small self-rolled markdown subset — **bold**, *italic*, auto-linked URLs (reusing the existing linkify), newlines to <br> — deliberately a new function, not a change to formatDescription: that one renders uploaded GPX/park4night content, which is untrusted, and docs/nps-resources.adoc already has a specific call not to add markdown rendering to that path. A note's body is written by the logged-in viewer themselves, not uploaded, so that concern doesn't apply here — the escape-then-selectively-markup order (linkify first, since it does its own escaping, then wrap already-escaped text in real <strong>/<em> tags) keeps it safe either way. Verified live: title renders in the popup header, **bold**/*italic*/ a URL in the body all render correctly. Full test suite: 115 runs, 0 failures (unaffected — description is just another property, not something the backend routes inspect).
This commit is contained in:
1 parent
2a22906a68
commit
465a644365
4 files changed
+74
-20
No files matched your search
+19
-2
@@ -869,7 +869,8 @@ html, body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.notes-panel__text {
|
||||
.notes-panel__title,
|
||||
.notes-panel__body {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font: inherit;
|
||||
@@ -877,6 +878,13 @@ html, body {
|
||||
padding: 4px 6px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.notes-panel__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.notes-panel__body {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
@@ -1053,7 +1061,8 @@ html, body {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.gpx-popup__edit-text {
|
||||
.gpx-popup__edit-title,
|
||||
.gpx-popup__edit-body {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font: inherit;
|
||||
@@ -1061,6 +1070,14 @@ html, body {
|
||||
padding: 4px 6px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.gpx-popup__edit-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.gpx-popup__edit-body {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user