Posted to Forums -> "How do I..." and mailed to support
Not sure if I should've sent this to the developer's list.
I've got some scripts that build story nodes from plaintext files. The files, unfortunately, have linebreaks in bizarre places. Drupal handles the paragraphs correctly when converting to HTML, but I would like to remove entirely the piece that converts linebreaks to '<br />' tags.
I had assumed that this was taking place in "function _filter_autop($text)" in filter.module, but after removing every preg_replace call that involved '<br />' tags, (e.g., "$chunk = preg_replace('|<br />\s*|', "\n\n", $chunk);") from that function, I found that drupal was still inserting the unwanted linebreaks.
Can someone please tell me where this is happening in drupal? I've been grepping myself silly trying to find it.
You should be able to configure an input format that simply does not include the linebreak converter.
admin>>filters>>[configure]
Select the filters that you want (skip the linebreak converter) and then arrange them in the order you want.
Djun
On 15-Dec-2005, at 7:03 AM, salvador@progressivetrail.org wrote:
Posted to Forums -> "How do I..." and mailed to support
Not sure if I should've sent this to the developer's list.
I've got some scripts that build story nodes from plaintext files. The files, unfortunately, have linebreaks in bizarre places. Drupal handles the paragraphs correctly when converting to HTML, but I would like to remove entirely the piece that converts linebreaks to '<br />' tags.
I had assumed that this was taking place in "function _filter_autop ($text)" in filter.module, but after removing every preg_replace call that involved '<br />' tags, (e.g., "$chunk = preg_replace('| <br />\s*|', "\n\n", $chunk);") from that function, I found that drupal was still inserting the unwanted linebreaks.
Can someone please tell me where this is happening in drupal? I've been grepping myself silly trying to find it. -- [ Drupal support list | http://lists.drupal.org/ ]
Maybe I wasn't clear. I want to adjust the line-break converter so that handles <p>'s the way that it currently does, but don't want it to insert <br>'s. I don't believe that this is something that I can do through the web interface, I need to modify the underlying code. I thought that this would be done in filter.module, but the changes I mentioned below don't seem to work.
Would this be a better question for the dev list?
On Thu, 15 Dec 2005, puregin wrote:
You should be able to configure an input format that simply does not include the linebreak converter.
admin>>filters>>[configure]
Select the filters that you want (skip the linebreak converter) and then arrange them in the order you want.
Djun
On 15-Dec-2005, at 7:03 AM, salvador@progressivetrail.org wrote:
Posted to Forums -> "How do I..." and mailed to support
Not sure if I should've sent this to the developer's list.
I've got some scripts that build story nodes from plaintext files. The files, unfortunately, have linebreaks in bizarre places. Drupal handles the paragraphs correctly when converting to HTML, but I would like to remove entirely the piece that converts linebreaks to '<br />' tags.
I had assumed that this was taking place in "function _filter_autop($text)" in filter.module, but after removing every preg_replace call that involved '<br />' tags, (e.g., "$chunk = preg_replace('|<br />\s*|', "\n\n", $chunk);") from that function, I found that drupal was still inserting the unwanted linebreaks.
Can someone please tell me where this is happening in drupal? I've been grepping myself silly trying to find it. -- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On 15-Dec-2005, at 10:03 AM, salvador@progressivetrail.org wrote:
Maybe I wasn't clear. I want to adjust the line-break converter so that handles <p>'s the way that it currently does, but don't want it to insert <br>'s. I don't believe that this is something that I can do through the web interface, I need to modify the underlying code. I thought that this would be done in filter.module, but the changes I mentioned below don't seem to work.
Would this be a better question for the dev list?
Sorry, I missed the point of your question.
This probably is a developer list question.
I'd suggest that you create a new input filter - start by copying the line-break filter, and hack on that.
Cheers, Djun
On Thu, 15 Dec 2005, puregin wrote:
You should be able to configure an input format that simply does not include the linebreak converter.
admin>>filters>>[configure]
Select the filters that you want (skip the linebreak converter) and then arrange them in the order you want.
Djun
On 15-Dec-2005, at 7:03 AM, salvador@progressivetrail.org wrote:
Posted to Forums -> "How do I..." and mailed to support Not sure if I should've sent this to the developer's list. I've got some scripts that build story nodes from plaintext files. The files, unfortunately, have linebreaks in bizarre places. Drupal handles the paragraphs correctly when converting to HTML, but I would like to remove entirely the piece that converts linebreaks to '<br />' tags. I had assumed that this was taking place in "function _filter_autop($text)" in filter.module, but after removing every preg_replace call that involved '<br />' tags, (e.g., "$chunk = preg_replace('|<br />\s*|', "\n\n", $chunk);") from that function, I found that drupal was still inserting the unwanted linebreaks. Can someone please tell me where this is happening in drupal? I've been grepping myself silly trying to find it. -- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Filters have very agressive caching.You should do a cache wipe if you want to see the result of new or hacked filters.
Bèr
Op donderdag 15 december 2005 19:52, schreef puregin:
On 15-Dec-2005, at 10:03 AM, salvador@progressivetrail.org wrote:
Maybe I wasn't clear. I want to adjust the line-break converter so that handles <p>'s the way that it currently does, but don't want it to insert <br>'s. I don't believe that this is something that I can do through the web interface, I need to modify the underlying code. I thought that this would be done in filter.module, but the changes I mentioned below don't seem to work.
Would this be a better question for the dev list?
Sorry, I missed the point of your question.
This probably is a developer list question.
I'd suggest that you create a new input filter - start by copying the line-break filter, and hack on that.
Cheers, Djun
On Thu, 15 Dec 2005, puregin wrote:
You should be able to configure an input format that simply does not include the linebreak converter.
admin>>filters>>[configure]
Select the filters that you want (skip the linebreak converter) and then arrange them in the order you want.
Djun
On 15-Dec-2005, at 7:03 AM, salvador@progressivetrail.org wrote:
Posted to Forums -> "How do I..." and mailed to support Not sure if I should've sent this to the developer's list. I've got some scripts that build story nodes from plaintext files. The files, unfortunately, have linebreaks in bizarre places. Drupal handles the paragraphs correctly when converting to HTML, but I would like to remove entirely the piece that converts linebreaks to '<br />' tags. I had assumed that this was taking place in "function _filter_autop($text)" in filter.module, but after removing every preg_replace call that involved '<br />' tags, (e.g., "$chunk = preg_replace('|<br />\s*|', "\n\n", $chunk);") from that function, I found that drupal was still inserting the unwanted linebreaks. Can someone please tell me where this is happening in drupal? I've been grepping myself silly trying to find it. -- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]