Menu

A question about function setNote()

2016-01-14
2016-01-16
  • Robertonisola

    Robertonisola - 2016-01-14

    Hi friends,

    in one of my scripts I used function setNote() like this:

    node.setNote('<html><body>This should be set in italics</body></html>')

    After executing the above function, I expected the result to be:

    This should be set in italics

    However this was what I got:

    This should be set in
    italics

    Why was the word "italics" put in a new line? Is there anyway to get my expected result?

    FYI, my Freeplane version is 1.3.12. However I have tried 1.5.x but the result was the same.

    Thank you.

     

    Last edit: Robertonisola 2016-01-14
  • Volker Börchers

    Note.setNote() does conversions, use Note.setNoteText() instead:

    node.noteText = '<html><body>This should be set in italics</body></html>'
    

    Volker

     
  • Robertonisola

    Robertonisola - 2016-01-15

    Hi volker, I tried your solution too. I entered this:

    And the result was:

    However what I expected is something like this:

    Thanks.

     
  • Volker Börchers

    The problem is the missing paragraph around the text. All of these do work:

    node.note = '<html><body><p>This should be set in <i>italics</i></p></body></html>'
    node.noteText = '<html><body><p>This should be set in <i>italics</i></p></body></html>'
    node.note = '<html><body><p>This should be set in <i>italics</i>
    node.noteText = '<html><body><p>This should be set in <i>italics</i>'
    
     
  • Robertonisola

    Robertonisola - 2016-01-16

    Thank you again, Volker! This solution worked.

    I'm new to HTML so I didn't know this basic stuff.

    FYI, I'm trying to implement the 'highlighted-results' text search feature via script (which I mentioned in another thread), so I need to use this function.

     
  • Volker Börchers

    FYI, I'm trying to implement the 'highlighted-results' text search feature via script (which I mentioned in another thread), so I need to use this function.

    Nice - come back if you need more help!

    Volker