test if selection is enclosed in a tag?
- Hi gang,
I was thinking about writing a clip CheckTagInclusion that detects
whether the selected text is enclosed within a specified tag. Has
anyone written this already?
e.g. If I have the code:
<chunk>Hi there. Here's something <strong>really</strong>
If select from start of "something" to end of "interesting" and then run
CheckTagInclusion(^$GetSelection$) and specify "chunk" in a dialog box,
it will return "1" for success. But if I run it and specify "strong",
it will return 0 (failure).
By the way, any clever way to send this clip both the selection and the
tag to check for in its argument, e.g.
Stephen B. Gilbert, Ph.D.
This message is intended only for the use of the addressee(s) named
herein. The information contained in this message is confidential and
may constitute proprietary or inside information. Unauthorized review,
dissemination, distribution, copying or other use of this message,
including all attachments, is strictly prohibited and may be unlawful.
If you have received this message in error, notify us immediately
by return e-mail and destroy this message and all copies thereof,
including all attachments.