if you remember some of the discussion on this that is relevant, please tune in.

As notes are new in 3.0, we should have it right from the beginning.
There appears to be a problem though:  see  and related

I won't have time in the near future to look at this, and the person who wrote the code also is not around, so somebody should step up to investigate.
It appears the <gramps>... </gramps> tag is added sometimes needlessly. Some logical way needs to be found to handle this. I don't understand why not all notes can have this root tag. Differences could be given in attributes, and doing a get on a text could do eg conversion based on this attribute (preformatted, markup or not, ...).

We have to allow also for users typing < and > in the note without messing that up in eg preview and note code, we need to allow for markup or not markup, ...

I guess the regex to remove < code > should only work on the known gramps code instead of on all, so eg in DisplayModels/, the column_preview method has:
   note = re.sub(r'(<.*?>)', '', note)
which is too general. It should probably also be in DbUtils instead, as it is needed in other places too and links to how data in database is stored. An alternative would look like :

myKeywords = ['Keyword1', 'Keyword2', 'Keyword3']
for line in note.text:
      for myKeyword in myKeywords:
          mkwIndex = line.find(myKeyword)
          while mkwIndex >= 0:
               #  here code to remove <keyword .....> and </keyword>, eg a regex to find it, remove it,
               mkwIndex = line.find(myKeyword)

Well, just a start, it needs investigating...