I would like to parse the text in a draft according to more complicated rules than what is currently possible with existing widgets, e.g. tm-edit-text-operation.
I have tried this.wiki.setText(…), but it doesn’t work.
What would be the easiest way to change the text field in a Draft Tiddler according to arbitrary rules?
I did not explain my goals properly. I would basically like to create a new EditorToolbar button similar to bold, italic etc. but with custom functionality.
I have successfully created buttons that can edit the text in normal Tiddlers but I cannot do the same when the Tiddler is in draft mode. Would there be an easy way to do this?
I have added a picture to help illustrate my goal. Just as an example, what I could do is that when the circled button is pressed, the text before " xx " would be a new field, the text after it would become the field content. The text would then be removed from the text area. All this should happen while the Tiddler is in draft mode.
It was enough and I got the idea. I’m now able to achieve what I want.
I did not know one could so easily create own functions that react to sendmessage. I was afraid I would have to modify the core and create own event listeners etc. which is currently out of my abilities.
Now I was able to create a function that operates “inside” tm-edit-text-operation. I suppose it would similarly be possible to react to custom created messages as well, e.g. tm-user-specified-message?