surround with tag on cursor position
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
surround with tag on cursor position
Post by shikhar_472 »
Hi Team,
I want to perform the surround with tag on cursor position if cursor is on start of the word or end of the word or in between the word on action of bold i want to surround that word on selection of word its working fine but I want to surround the word on cursor position without selecting the word in XML web author view.
Thanks,
Shikhar.
I want to perform the surround with tag on cursor position if cursor is on start of the word or end of the word or in between the word on action of bold i want to surround that word on selection of word its working fine but I want to surround the word on cursor position without selecting the word in XML web author view.
Thanks,
Shikhar.
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: surround with tag on cursor position
Hello,
Unfortunately, I do not understand what you are trying to obtain.
Can you please offer some context about your use case?
If you need our guidance in using the API you can specify some code that you already have (if it could be helpful), what did not work, and what exactly you need to obtain.
Best Regards,
Mihaela
Unfortunately, I do not understand what you are trying to obtain.
Can you please offer some context about your use case?
If you need our guidance in using the API you can specify some code that you already have (if it could be helpful), what did not work, and what exactly you need to obtain.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: surround with tag on cursor position
Post by shikhar_472 »
Hi Team,
So i am using surroundwithfragment operation to make the text bold so i am able to make it when i am selecting the word and surrounding it with <bold></bold> tag.
Now i am have a scenario suppose word is Test and my cursor is start of the Test or end of the Test or in between the Test the moment i click on bold action Test should automatically wrap inside bold like <bold>Test</bold>. this is not working.
Thanks,
Shikhar.
So i am using surroundwithfragment operation to make the text bold so i am able to make it when i am selecting the word and surrounding it with <bold></bold> tag.
Now i am have a scenario suppose word is Test and my cursor is start of the Test or end of the Test or in between the Test the moment i click on bold action Test should automatically wrap inside bold like <bold>Test</bold>. this is not working.
Thanks,
Shikhar.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: surround with tag on cursor position
Post by cristi_talau »
Hello,
The surroundInFragment method is a low-level method that does not detect words to make bold.
If you want a more refined behavior you should use the following operation in your action ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation . If you sign up for the SDK access, you can also get the source code for this operation: https://www.oxygenxml.com/oxygen_sdk/do ... ource-code .
Best,
Cristian
The surroundInFragment method is a low-level method that does not detect words to make bold.
If you want a more refined behavior you should use the following operation in your action ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation . If you sign up for the SDK access, you can also get the source code for this operation: https://www.oxygenxml.com/oxygen_sdk/do ... ource-code .
Best,
Cristian
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: surround with tag on cursor position
Post by shikhar_472 »
Hi Cristian,
I want t use surroundInFragment feature along with toggle operation is that possible,
because if i am doing bold again using togglewithsurround operation it is unwrapping the element.
Thanks,
Shikhar.
I want t use surroundInFragment feature along with toggle operation is that possible,
because if i am doing bold again using togglewithsurround operation it is unwrapping the element.
Thanks,
Shikhar.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: surround with tag on cursor position
Post by cristi_talau »
Hello,
This means that you cannot use the ToggleSurroundWithElementOperation directly. However, you can still look at the source code and draw some inspiration from there to implement your own operation.
Best,
Cristian
This means that you cannot use the ToggleSurroundWithElementOperation directly. However, you can still look at the source code and draw some inspiration from there to implement your own operation.
Best,
Cristian
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service