Notepad++ WebEdit



  • It looks like WebEdit does not work anymore with NPP, even the 32bits version. I need a way to select a piece of text and by using a shortcut add tags around it. For example (but not limited to):

    Fred --ctrl-b–> <strong>Fred</strong>
    Wilma --ctrl-b–> <strong>Wilma</strong>

    Any way to do it?



  • Maybe with a scripting language as mentioned in your other post?

    I’m guessing the issue is the upgrade of the Scintilla component in Notepad++ 7.7. While it provides much more functionality, it can break older plugins. WebEdit looks to be recently updated, (November, 2018), but alas, that’s not recent enough for the N++ 7.7 changes.

    I took a quick look to see if I could make the necessary edits to the plugin, but it’s written in Oberon-2 and I have no clue how to begin with that.

    Cheers.



  • Here’s a quick example with NppExec which will handle Bold for HTML and Markdown based on file extension:

    NPP_CONSOLE keep
    IF "$(EXT_PART)"~=".html" THEN
        SEL_SETTEXT <b>$(CURRENT_WORD)</b>
    ELSE IF "$(EXT_PART)"~=".md" THEN
        SEL_SETTEXT __$(CURRENT_WORD)__
    ENDIF
    

    Save that script as “Bold Current Word” and add it to the Macro menu with NppExec and then use “Settings” => “Shortcut Mapper…” to map the CTRL-B shortcut to it.

    Adding additional scripts to do Italics for example can be done with simple modifications to the above example and is left as an exercise for the reader.

    Cheers.


Log in to reply