Closed (fixed)
Project:
Content Injector (formerly AdSense Injector)
Version:
6.x-3.1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Dec 2011 at 17:19 UTC
Updated:
4 Aug 2013 at 21:23 UTC
Comments
Comment #1
mcurry commentedActually, this is a very good question.
One thing to be aware of: the rendered HTML for any given node will depend on the input filters being used for the node.
My first question: what does the node's rendered HTML look like? Can you post a HTML snippet? (Just the node body section, please!)
Note to self: I need to document the xPath stuff, or provide 'shortcuts' that allow you to specify common patterns without resorting to using raw xPath expressions.
Comment #2
drein commentedOk, this is a piece of source from a webpage, I'm logged as admin so you will see add disabled.
the ads will appear after two paragraph, because I put p[2] instead of 3.
Comment #3
drein commentedsorry, I will reply tomorrow because I must understand what's happening with filters on my site. sometime I see
<br>, other time<br />, so I assume filters are the key.Comment #4
mcurry commentedThe built-in line break converter input filter has had a number of issues reported, specifically about interactions with
<p>...</p>blocks. In my tests (on Drupal 7), some hand-entered br tags get converted to<p>...</p>blocks and others are left as-is. In any case, just beware that line breaks / br conversion issues may gum up the works rather badly.For example, the following source text:
Is converted to:
So, as you can see, the HTML filter / line break converter has done a rather nasty thing: it's put
<p>...</p>blocks around the<br/>tags, and it's changed my self-closing, syntactically-correct XHTML<br/>tags into<br>(it's removed the self-closing '/' from the br tags.) Which means the xPath expression/html/body/br[4]won't work, because it's looking for the fourth<br>tag at the root level of the DOM. The xPath expression that might work given the mangled HTML output:/html/body/p/br[4]-- which says: find the fourth BR tag nested within top-level P elements (I'd need to verify this) -- and even that may not be what you want.For more on the line break converter problems, see:
#653988: Line break filter corrupts existing XHTML
#659580: Specify what the line break converter should do and rewrite it in DOM
More: Core Issues: Line Break
And: Core Issues: Line Break Paragraphs
Is there a reason why you are trying to trigger insertion on
<br/>tags?(BTW, I expected DOM-based insertion would open a can of worms. This may be the tip of the iceberg, so hold on to your life jackets.)
Comment #5
greg boggs