<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ticket search results</title><link>https://forge-allura.apache.org/p/allura/tickets/</link><description>You searched for labels:"markdown-editor"</description><language>en</language><lastBuildDate>Thu, 14 Mar 2019 02:19:57 -0000</lastBuildDate><item><title>In editor, pasting should be auto-wrapped</title><link>https://forge-allura.apache.org/p/allura/tickets/7983/</link><description>When pasting a large chunk of text into the markdown editor, it often would be useful to automatically wrap it with `~~~~` or indent it.  People who paste code snippets or log lines would benefit from this, especially if they are not familiar with markdown and don't realize it needs to be in a code block to avoid `__foo__` from getting formatted etc.  I think this would help alleviate problems expressed in https://sourceforge.net/p/forge/feature-requests/134/

However, that won't be appropriate all the time, since some people could paste large amounts of regular text or even markdown formatting (e.g. restructuring a wiki page).  Turning it into a code block won't be helpful.  We'll need some sort of UI to make this work well.  I am thinking that we show a notification after it happens, and tell the user how they can click the code snippet button to undo it.  We can also save a cookie/sessionStorage setting to not do it again. 

Here's an autoindent snippet proof-of-concept:

~~~~
cm = editor.codemirror;

// based on https://github.com/codemirror/CodeMirror/issues/2120
cm.on("change", function(cm, change) {
  if (change.origin != "paste" || change.text.length &lt; 2) {
    return;
  }
  var spaces = cm.options.tabSize;
  cm.operation(function() {
    for (var line = change.from.line, end = CodeMirror.changeEnd(change).line; line &lt;= end; ++line) {
      cm.indentLine(line, spaces);
    }
  });
});
~~~~</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Fri, 04 Sep 2015 14:24:45 -0000</pubDate><guid>https://forge-allura.apache.org/p/allura/tickets/7983/</guid></item><item><title>Editor should autocomplete artifact references and macros</title><link>https://forge-allura.apache.org/p/allura/tickets/7982/</link><description>In the markdown editor, it would be great if you type `[` it shows a list of artifact choices. And if you type `[[` it shows a list of macro choices.  Using the autocomplete addon for codemirror can get us a lot of the way there.  https://codemirror.net/doc/manual.html#addon_show-hint

We probably will want to save recently visited tickets, wiki pages, and other artifacts in the browser's localStorage or sessionStorage, so that we can give useful initial choices.  We'll also need to do ajax lookups to get a full list of matching artifacts, as well as mount points and project names for cases like `[wiki:Baz]` or `[proj:wiki:Baz]`.

The UI could be extra nice if it didn't require typing a `[` first in some cases, since some people might not know that syntax.  If you just typed `#` it could suggest tickets and put the `[` in for you automatically if you select one.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Thu, 14 Mar 2019 02:19:57 -0000</pubDate><guid>https://forge-allura.apache.org/p/allura/tickets/7982/</guid></item><item><title>Research odd behavior / bugs in simplemde</title><link>https://forge-allura.apache.org/p/allura/tickets/7956/</link><description>See if these are upstream bugs, report them, see if we can fix them

* when you get multiple levels deep in a list, some lines are colored green
* any sort of `foo:bar` text with a colon in it gets turned into a link style.  Should have a smarter URL pattern
* within a blockquote section, the Image button is highlighted instead of blockquote button
* `#foobar` heading without a space after #, does not get styled like a heading
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Mon, 21 Sep 2015 14:05:40 -0000</pubDate><guid>https://forge-allura.apache.org/p/allura/tickets/7956/</guid></item></channel></rss>