module EnClient::FormatNoteOperation
Constants
- NOTE_DEFAULT_FOOTER
- NOTE_DEFAULT_HEADER
Private Instance Methods
set_attribute_and_format_content!(note)
click to toggle source
# File usr/lib/evernote-mode/enclient.rb, line 449 def set_attribute_and_format_content!(note) note.attributes = Evernote::EDAM::Type::NoteAttributes.new if note.editMode == "TEXT" note.content = to_xhtml note.content if note.content note.attributes.sourceApplication = APPLICATION_NAME_TEXT elsif note.editMode == "XHTML" note.attributes.sourceApplication = APPLICATION_NAME_XHTML end end
to_xhtml(content)
click to toggle source
# File usr/lib/evernote-mode/enclient.rb, line 459 def to_xhtml(content) content = CGI.escapeHTML content content.gsub! %r{ }, %Q{ } content.gsub! %r{(?:\r\n)|\n|\r}, %Q|<br clear="none"/>| content = NOTE_DEFAULT_HEADER + content + NOTE_DEFAULT_FOOTER end