Skip to content

Instantly share code, notes, and snippets.

@hmbrg
Last active December 11, 2016 17:43
Show Gist options
  • Select an option

  • Save hmbrg/b78a10b3e3ae3eb665657eaa95f44cdc to your computer and use it in GitHub Desktop.

Select an option

Save hmbrg/b78a10b3e3ae3eb665657eaa95f44cdc to your computer and use it in GitHub Desktop.
Evernote H2 converter
javascript:(function()%7B%24(%24(%22%23en-common-editor-iframe%22).contents()%5B0%5D).find(%22u%20b%2C%20b%20u%22).each(function(i)%20%7Bvar%20text%20%3D%20%24(this).text()%3Bvar%20parent%20%3D%20%24(this).parent()%3B%24(this).remove()%3Bparent.replaceWith(%22%3Ch2%3E%22%20%2B%20text%20%2B%20%22%3C%2Fh2%3E%22)%3B%7D)%7D)()
$($("#en-common-editor-iframe")
.contents()[0])
.find("u b, b u")
.each(function(i) {
var text = $(this).text();
var parent = $(this).parent();
$(this).remove();
parent.replaceWith("<h2>" + text + "</h2>");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment