Autocomplete to insert HTML?

Not sure this is an issue; might be WAD.

Tried autocomplete to insert a frequently-used div. (See generic version.)

When inserted in draft, appears to be fine.

However, it appears to be somehow actually rendering the opening div angle brackets as HTML entities, and wrapping all in a p tag.

What makes me wonder if it’s a bug is that the CLOSING div tag is fine. (And, also, that the entities don’t appear as such in the draft; only when processed.)

See preview and HTML copied from preview:

Also happens when:

  • blank line or text precedes div tag in autocomplete body

  • text precedes autocomplete insertion

You have smart-quotes, not straight-quotes, around the class attribute. I suspect that is throwing off the Markdown parser, because that is not valid HTML.

updated second photo annotation

I’m certain you’re correct about the reason!

What’s weird is… I typed it straight into the autocomplete editor, and have smart quotes off in Drafts settings.

Guessing autocomplete editor is using iOS keyboard, bypassing Drafts prefs, or something?

Tried it two ways — copy/paste and type-in, and, yes, type in uses smart quotes.



That’s a standard text entry field, not the Drafts editor, so it will follow your usual field settings - see the Smart Quotes entries under Substitutions in the field’s context menu.

Thanks. Please feel free to close the topic.