chmllr / notehub

A pastebin for markdown pages.
MIT License
273 stars 33 forks source link

Editing replaces any occurences of "$`" with html source #41

Closed boviex closed 7 years ago

boviex commented 7 years ago

A note containing the following:

`this will break when edited: $`

will publish correctly but when editing becomes:

`this will break when edited: <!DOCTYPE html>
<html style="height: 100%;">

<head>
  <title>NoteHub — New Page</title>
  <meta charset="UTF-8" />
  <meta content="width=device-width, initial-scale=1.0" name="viewport" />
  <link href="/style.css" rel="stylesheet" type="text/css" />
  <script src="//cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js" type="text/javascript"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/blueimp-md5/1.0.1/js/md5.min.js" type="text/javascript"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js" type="text/javascript"></script>
  <script src="/js/publishing.js" type="text/javascript"></script>
  <base target="_blank">
</head>

<body onload="onLoad()" style="height: 100%">
  <div id="editContainer">
    <form id="editPane" action="/note" autocomplete="off" method="POST" target="_self">
      <input id="action" name="action" value="UPDATE" type="hidden" />
      <input id="id" name="id" value="pytv0" type="hidden" />
      <input id="password" name="password" type="hidden" />
      <input id="session" name="session" type="hidden" value="240812222d3940475d758aacd61c02a42f7ba" />
      <input id="signature" name="signature" type="hidden" />
      <textarea id="note" name="note">
chmllr commented 7 years ago

Thanks for reporting! Fixed in e9c8ad4fdb8e6897fe911de5381bf53c2d27f418.