publiclab / inline-markdown-editor

An inline wysiwyg markdown document editor based on replacing string subsections. WYSIWYG possible via woofmark.
https://publiclab.github.io/inline-markdown-editor/examples/
GNU General Public License v3.0
31 stars 37 forks source link

Fail on false + preserving HTML blocks as single sections #49

Closed jywarren closed 5 years ago

jywarren commented 5 years ago

Apologies for doing this in a single PR, i wrote it on a ✈️ and am just uploading together here. I need a little help with the false test passing though!

jywarren commented 5 years ago

OK, this obviously needs a bit of work, but I hope it makes sense...

jywarren commented 5 years ago

@rexagod does this make sense?

jywarren commented 5 years ago

Yep exactly! I'm using jQuery to separate and preserve HTML blocks.

I'm about to take off on a plane again so won't have time to work on this unfortunately for a bit!

On Thu, Feb 21, 2019, 4:46 PM Pranshu Srivastava notifications@github.com wrote:

@rexagod commented on this pull request.

In src/divideIntoSections.js https://github.com/publiclab/inline-markdown-editor/pull/49#discussion_r259148687 :

+module.exports = function divideIntoSections(content) {

  • var sections = [];
  • content = content.replace(/[\n]{2,}/g, "\n\n"); // manage double newlines (not sure exactly?)
  • // Split by ... blocks, then parse the markdown text between it.
  • // If we don't do this, it'll fail if there are double newlines inside HTML blocks, esp. Githubissues.
  • Githubissues is a development platform for aggregating issues.