Skip to content
Discussion options

You must be logged in to vote

It's the popular student strategy "write the answer that you know, instead of reading the question"!
How about this?

It sets/changes the caption on all images. The regex can be adjusted to only do the first image, or only to add captions where none exist, depending on usage preferences.

api.addButtonToToolbar({
    title: 'Caption',
    icon: 'game',
    shortcut: 'alt+i',
    action: async function () {
        const curnote = await api.getActiveTabNote();

        await api.runOnBackend(async (noteId) => {
            const note = api.getNote(noteId);
            if(note.hasLabel('Caption')){
                const content=note.getContent();
                const newcap="<figcaption>" + …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@PhilB-RLB
Comment options

Comment options

You must be logged in to vote
1 reply
@PhilB-RLB
Comment options

Answer selected by PhilB-RLB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants