Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem is when DIV is placed into P.
I have done some changes to code. See attached patch
But this is NOT an enterprise-solution. This is quick and dirty fix of problem that really works.
Really good solution is to stop using DIV at all.
Thanks for very useful module.
Comment | File | Size | Author |
---|---|---|---|
geshifilter-6.x-1.2_fixed.diff | 1.16 KB | VladSavitsky | |
Comments
Comment #1
VladSavitsky CreditAttribution: VladSavitsky commentedForgot to write that I'm using "Use no container" to avoid all DIV's in code of page.
Comment #2
soxofaan CreditAttribution: soxofaan commentedCan you give an example of both the used input filter pipeline and the body text?
GeSHi filter does not add the <p> tags itself, I guess those come from the line break filter or something.
I think this is out of scope of the GeSHi filter itself, so I'm tempted to mark this as "won't fix".
What is actually wrong with using DIVs?
Note that the GeSHi library will use SPANs instead of DIVs automatically if there is no newline in the codeblock.
Eg.
[code]print "wello horld"[/code]
will use a span and can be used inside paragraphswhile
will use a DIV and should be used as a standalone block.
Comment #3
saper CreditAttribution: saper commentedTo give you the example from my site (http://saper.info/pl/node/4)
My setup (I am not the original poster)
* Drupal 6.12
* GeSHi filter 6.x-1.2
* Zen skin (6.x-dev as of May 2009)
* GeSHi content node disabled
* GeSHi filter enabled
* Pathfilter enabled (although not used)
Enabled i18n with block and taxonomy translation
GeSHi filter settings:
* GeSHi library version 1.0.7.22 detected
* Use input format specific tag settings is OFF
* Generic syntax highlighting tags: <code> <blockcode>
* Tag style:
* Also apply syntax highlighting to <?php ... ?> style PHP source code blocks is OFF
* Default highlighting mode: plain text
* no line numbers
* Use built-in PHP function highlight_string() for PHP source code is OFF
* Enable GeSHi keyword URLs is ON
* Use CSS classes and an automatically managed external CSS style sheet.
* Use no container
Filters tab: No known filter conflicts were detected.
This node is using "Full HTML" filter, filter order:
- URL addresses 0
- Newlines 1
- GeSHi filter 10
Enabling HTML clean up does not seem to bring any difference.
Rendered XHTML:
Comment #4
nschloe CreditAttribution: nschloe commentedsubscribing
Comment #5
soxofaan CreditAttribution: soxofaan commentedok, confirmed
The problem is that Drupal core's line break filter is responsible for those <p>'s.
I'm not sure yet how this can be avoided or if it's feasible to remove the <p>'s again in a clean way.
Comment #6
basvredelingI think you should replace the < div > tags with < code > instead of < span >, and style all code.geshifilter tags to display as block. Should validate correctly. For example: http://codeculture.nl/article/20090912/jroute-and-module-visibility
Comment #7
xandeadx CreditAttribution: xandeadx commentedsubscribing
Comment #8
gingo CreditAttribution: gingo commentedTry this quick fix: place GeSHi filter before the line break filter and before HTML corrector. Hope it helps.
Comment #9
kenorb CreditAttribution: kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.