(self, nids, field)
return edited
Add field contents to to note tags
Add field contents to to note tags
Add field contents to to note tags
def fieldToTags(self, nids, field):
    """Add field contents to to note tags"""
    edited = 0
    for nid in nids:
        note = self.mw.col.getNote(nid)
        if field not in note:
            continue
        html = note[field]
        text = stripHTML(html).strip()
        if not text:
            continue
        tag = SEPARATOR.join(text.split())
        if note.hasTag(tag):
            continue
        note.addTag(tag)
        note.flush()
        edited += 1
    return edited
def fieldToTags ( self , nids , field ) : edited = 0 for nid in nids : note = self . mw . col . getNote ( nid ) if field not in note : continue html = note [ field ] text = stripHTML ( html ) . strip ( ) if not text : continue tag = SEPARATOR . join ( text . split ( ) ) if note . hasTag ( tag ) : continue note . addTag ( tag ) note . flush ( ) edited += 1 return edited