(browser)
Clears the formatting for every selected note.
    Also creates a restore point, allowing a single undo operation.

    Parameters
    ----------
    browser : Browser
        the anki browser from which the function is called
Clears the formatting for every selected note.
    Also creates a restore point, allowing a single undo operation.
Clears the formatting for every selected note . Also creates a restore point allowing a single undo operation .
def onClearFormatting(browser):
    """
    Clears the formatting for every selected note.
    Also creates a restore point, allowing a single undo operation.

    Parameters
    ----------
    browser : Browser
        the anki browser from which the function is called
    """

    nids = browser.selectedNotes()
    if not nids:
        tooltip(_("No cards selected."), period=2000)
        return

    mw.checkpoint("Batch-Remove Field Formatting")
    mw.progress.start()
    for nid in nids:
        note = mw.col.getNote(nid)
        note.fields = stripFormatting(note.fields)
        note.flush()
    mw.progress.finish()
    mw.reset()
def onClearFormatting ( browser ) : nids = browser . selectedNotes ( ) if not nids : tooltip ( _ ( "No cards selected." ) , period = 2000 ) return mw . checkpoint ( "Batch-Remove Field Formatting" ) mw . progress . start ( ) for nid in nids : note = mw . col . getNote ( nid ) note . fields = stripFormatting ( note . fields ) note . flush ( ) mw . progress . finish ( ) mw . reset ( )