<span class="SomeName"> doesn't work with Blocked elements

daneesia - March 22, 2008 - 19:55
Project:Glossary
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:mwrochna
Status:closed
Description

Example:

In .css file

.noStyle {
}

In "Blocked elements" (filtered and full)
acronym h1 h2 h3 h4 h5 h6 a noStyle li

#1

NancyDru - March 24, 2008 - 15:16
Status:active» postponed (maintainer needs more info)

I'm not sure what you're getting at here. "noStyle" is not an HTML element, therefore it shouldn't be in that list. What is it that you are trying to accomplish?

#2

daneesia - March 26, 2008 - 04:37

Correct.

I am simply trying to use a style defined in a CSS file as a "blocked element" so I can exclude common words that are in the glossary when they do not apply.

For example, if my glossary term is "Foo" and I have a sentence "Foo is to Bar as Bar is to Foo", I may not want one or either of these to appear as a glossary entry, so I would like to do something to exclude them like:

<p>Foo is to Bar as Bar is to <span class="noStyle">Foo</span></p>

In the above example, the idea is to show the glossary entry for the first occurrence of "Foo" but omit it for the second occurrence.

Now that I think of it, this might need to be re-filed as a feature request because that does not appear to be the intent.

#3

NancyDru - March 26, 2008 - 05:07
Status:postponed (maintainer needs more info)» fixed

Why not try doing it this way: http://drupal.org/node/201763#skipping

#4

daneesia - March 26, 2008 - 06:40
Category:bug report» feature request
Status:fixed» active

Yes this will work as work around, but I am still changing this to a feature request as it is still desirable to be able to use CSS styles as blocked elements as described above.

#5

NancyDru - March 26, 2008 - 14:06
Status:active» duplicate

http://drupal.org/node/208217

#6

daneesia - March 27, 2008 - 06:00
Status:duplicate» active

I do not agree that this is a duplicate.

Marking something with [no-glossary]mismatches[/no-glossary] is an inflexible solution.

And I still feel the <span>...</span> is both more flexible and is more ideal to address legacy HTML code where said span tags may already be in place.

Also note that adding [no-glossary]mismatches[/no-glossary] shows up in WYSIWYG plugins, which can be confusing to a person dealing with future edits.

#7

daneesia - March 27, 2008 - 06:00

I do not agree that this is a duplicate.

Marking something with [no-glossary]mismatches[/no-glossary] is an inflexible solution.

And I still feel the <span>...</span> is both more flexible and is more ideal to address legacy HTML code where said span tags may already be in place.

Also note that adding [no-glossary]mismatches[/no-glossary] shows up in WYSIWYG plugins, which can be confusing to a person dealing with future edits.

#8

NancyDru - March 27, 2008 - 12:40
Status:active» postponed

Did you read "Possible approaches" and further down where the idea of spanning was dismissed in favor of what was implemented?

Right now, we have serious performance problems in that area of code and there is no way I'm going to further complicate that issue by trying to add new code.

#9

mwrochna - April 26, 2008 - 08:50
Assigned to:Anonymous» mwrochna
Status:postponed» postponed (maintainer needs more info)

The attached patch searches for <span class="tag and </span> when .tag is added to the 'Blocked elements'. It's certainly not making the filter any slower (except for any additional tag to search for, of course). Tested on multibyte classnames, some help/documentation should be added. Remember to allow span tags in the html filter.
That's kind of a workaround - if you want to be able to have indented spans (you probably do, any </span> inside the blocking span will immediatly end it), I can add proper support - it shouldn't make the filter slower too.
But if you want a more flexible approach (i.e. <span style="" class="anothertag tag, <anytag class="tag) an xhtml parser should probably be used, someone would have to show me a module that's using one. And that would be slower, I think.

AttachmentSize
glossary.module.9.patch 953 bytes

#10

NancyDru - April 26, 2008 - 13:42
Status:postponed (maintainer needs more info)» needs review

Thank you again, Marcin. You're fabulous!

#11

NancyDru - April 26, 2008 - 16:23
Component:Miscellaneous» User interface
Status:needs review» needs work

@mwrochna: I'm marking this as PCNW because there really needs to be additional information added to the settings page. I will do that, so don't worry, Marcin. This is just to remind me to do it.

@daneesia: Since Marcin was nice enough to do this, there are certain restrictions you will need to follow:

  • The "class" attribute must be the first (or only) attribute of the "span" element.
  • The "span" tag and "class" attribute must be separated by a single space.
  • The "class" must be enclosed within double quotes. (This is preferred HTML practice anyway.)
  • The "span" tag and "class" attribute must be in lower case. (This is also preferred HTML practice.)

#12

NancyDru - April 26, 2008 - 17:13
Status:needs work» fixed

I am committing this on both -dev branches.

In addition to the above patch, I updated the description on the settings form and added a check for this in the filter tips.

#13

NancyDru - May 9, 2008 - 22:47
Status:fixed» closed

#14

daneesia - May 27, 2008 - 00:25
Status:closed» active

Nancy, Marcin, thank you for implementing this. I am just now getting around to testing this out and, as far as I can tell I have followed the instructions to the letter (and cleared all the caches etc.) and still no dice on this.

Here is the HTML snippet exactly as it appears within the node: <span class="noGlossary">Email</span>

Here is my blocked elements list exactly as it appears on the filtered and full tabs: acronym h1 h2 h3 h4 h5 h6 a .noGlossary

I copied and pasted from the blocked element list (less the period) to the node, so there is no chance of a mismatch and I cut and pasted directly from my site to here.

Oh and I grabbed the May 26th snapshot.

If there is any other information needed, please let me know.

Thanks,

Dan

#15

NancyDru - May 27, 2008 - 03:40

Please try without the capital letter. The filter translates everything to lower case before searching. Oh, and also, XHTML rules say it should be lowercase too.

#16

NancyDru - May 27, 2008 - 04:17
Status:active» postponed (maintainer needs more info)

#17

daneesia - May 27, 2008 - 19:52

No luck just changing the case.

#18

NancyDru - May 28, 2008 - 02:57

Hmm. Can you let me see an example, or paste some code and output here? This works fine in my site.

#19

daneesia - May 28, 2008 - 05:56

Okay, here is the example exactly as it appears:

Blocked elements: acronym h1 h2 h3 h4 h5 h6 a .noglossary

HTML:

<p>It is typically desirable to subscribe to a given content, such as a forum topic, so that when new information is posted, you will receive an email notification.</p><p>For content that was created by someone else, when you open the content, there will typically be a <b>Subscribe</b> link. When this link is selected, a list of methods to subscribe to the given content or similar content is provided.</p><p>Also, if you submit a comment on a given post, check the <b> <span class="noglossary">Email</span> me about replies to this comment</b> checkbox to receive emails whenever the page has been updated.</p><p>To see a list of your subscriptions and to set up general subscription preferences, select the <b>My Account</b> menu followed by the <b>Subscriptions</b> tab.</p><p>For more information, see the <a href="/Help/Subscriptions"><i>Subscriptions Help</i></a> page.</p>

Output:

<p>It is typically desirable to subscribe to a given content, such as a forum topic, so that when new information is posted, you will receive an email notification.</p><p>For content that was created by someone else, when you open the content, there will typically be a <b>Subscribe</b> link. When this link is selected, a list of methods to subscribe to the given content or similar content is provided.</p><p>Also, if you submit a comment on a given post, check the <b> <a class="glossary-term" href="/glossary/term/155"><acronym title="A user's email address. It is important that this is correct as all alerts are sent to this address.">Email</acronym></a> me about replies to this comment</b> checkbox to receive emails whenever the page has been updated.</p><p>To see a list of your subscriptions and to set up general subscription preferences, select the <b>My Account</b> menu followed by the <b>Subscriptions</b> tab.</p><p>For more information, see the <a href="/Help/Subscriptions"><i>Subscriptions Help</i></a> page.</p>

If there is any other information you would like me to provide, I'd be happy.

#20

NancyDru - May 29, 2008 - 00:45

I just pasted your settings and content into my test site and it worked perfectly. The "email" in you will receive an email notification. got flagged while the "email" in check the <b> <span class="noglossary">Email</span> me did not.

What other filter modules do you use that might be interfering? Does your input format allow <span>?

#21

daneesia - May 29, 2008 - 07:32
Status:postponed (maintainer needs more info)» fixed

I just was about to submit a long response and I started playing around trying to get you more information and I finally wound up deleting the post and re-entering it and it worked like magic.

(I did have the filter set to "Full HTML" in case you are still curious.)

Must have been another glitch somewhere outside of this module.

Anyway, I marked this as fixed.

BTW: I would be happy to document this feature for you in the documentation, but I am not sure how to do that (other than just writing it up and sending it to you). If you let me know how, I'll do it. (I have to write it up anyway since I must tell the site admins how to use this feature.)

Thanks for your support.

Dan

#22

NancyDru - May 29, 2008 - 13:30

Thanks, Dan. I'm not sure why it didn't work. I tried it with "Filtered HTML" when I did it. I'm glad it's fixed for now. Feel free to reopen this if it happens again.

You can either send it to me or join the Docs team and you can edit any handbook page. I definitely appreciate help with documentation.

#23

Anonymous (not verified) - June 12, 2008 - 13:31
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.