def revert_to_stored_markdown(self): """ Revert to the previous version of Markdown that was stored in the field. """ new_html = utility.convert_clean_md_to_html(self.md, put_breaks=True) self.insert_into_field(new_html, self.current_field) self.remove_warn_msg(self.editor, self.current_field)
def revert_to_stored_markdown(self): """ Revert to the previous version of Markdown that was stored in the field. """ new_html = utility.convert_clean_md_to_html(self.md, put_breaks=True) self.insert_markup_in_field(new_html, self.current_field) const.MARKDOWN_PREFS["disable_buttons"] = False const.MARKDOWN_PREFS["isconverted"] = False self.remove_warn_msg(self.editor_instance, self.current_field)
def overwrite_stored_data(self): """ Create new Markdown from the current HTML. """ clean_md = utility.strip_html_from_markdown(self.html, keep_empty_lines=True) clean_md = utility.remove_whitespace_before_abbreviation_definition(clean_md) if "<dl" in self.html: clean_md = utility.remove_leading_whitespace_from_dd_element(clean_md, add_newline=True) if re.search(const.IS_LINK_OR_IMG_REGEX, clean_md): clean_md = utility.escape_html_chars(clean_md) new_html = utility.convert_clean_md_to_html(clean_md, put_breaks=True) self.insert_into_field(new_html, self.current_field) self.remove_warn_msg(self.editor, self.current_field)
def overwrite_stored_data(self): """ Create new Markdown from the current HTML. """ clean_md = utility.convert_html_to_markdown(self.html, keep_empty_lines=True) clean_md = utility.remove_whitespace_before_abbreviation_definition( clean_md) if "<dl" in self.html: clean_md = utility.remove_leading_whitespace_from_dd_element( clean_md, add_newline=True) if re.search(const.IS_LINK_OR_IMG_REGEX, clean_md): clean_md = utility.escape_html_chars(clean_md) new_html = utility.convert_clean_md_to_html(clean_md, put_breaks=True) self.insert_markup_in_field(new_html, self.current_field) const.MARKDOWN_PREFS["disable_buttons"] = False const.MARKDOWN_PREFS["isconverted"] = False self.remove_warn_msg(self.editor_instance, self.current_field)
def overwrite_stored_data(self): """ Create new Markdown from the current HTML. """ clean_md = utility.convert_html_to_markdown( self.html, keep_empty_lines=True) clean_md = utility.remove_whitespace_before_abbreviation_definition( clean_md) if "<dl" in self.html: clean_md = utility.remove_leading_whitespace_from_dd_element( clean_md, add_newline=True) if re.search(const.IS_LINK_OR_IMG_REGEX, clean_md): clean_md = utility.escape_html_chars(clean_md) new_html = utility.convert_clean_md_to_html(clean_md, put_breaks=True) self.insert_markup_in_field(new_html, self.current_field) const.MARKDOWN_PREFS["disable_buttons"] = False const.MARKDOWN_PREFS["isconverted"] = False self.remove_warn_msg(self.editor_instance, self.current_field)