Index: ed_readmore.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ed_readmore/ed_readmore.module,v
retrieving revision 1.5.8.2.2.11.2.6
diff -u -p -r1.5.8.2.2.11.2.6 ed_readmore.module
--- ed_readmore.module 15 Sep 2009 20:06:58 -0000 1.5.8.2.2.11.2.6
+++ ed_readmore.module 15 Sep 2009 20:35:55 -0000
@@ -71,6 +71,13 @@ function ed_readmore_admin_settings() {
'#description' => t('For more information about how this is done, read this Angry Donuts post.', array('@link' => url('http://www.angrydonuts.com/the_nuisance_of_the_read_more_fl'))),
);
+ $form['ed_readmore_display']['ed_readmore_inline_elements'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Content wrapping elements'),
+ '#default_value' => variable_get('ed_readmore_inline_elements', 'p'),
+ '#description' => t('A comma seperated list of elements into which the Read More link may be inserted, if added inline.'),
+ );
+
$form['ed_readmore_display']['ed_readmore_remove'] = array(
'#type' => 'checkbox',
'#title' => t('Remove Read More link from links section'),
@@ -150,10 +157,12 @@ function ed_readmore_preprocess_node(&$v
*/
function ed_readmore_link_place($teaser, $node, $display) {
if ($display == 'inline') {
- $block_tags = '(?:p)';
- // Get last position of the last closing marker
- // If found, insert the link before the marker
- if (preg_match('!?'. $block_tags .'[^>]*>s*$!mi', $teaser, $match, PREG_OFFSET_CAPTURE)) {
+ $elements = check_plain(variable_get('ed_readmore_inline_elements', 'p'));
+ $elements = array_map('trim', explode(',', $elements));
+ $block_tags = '('. implode('|', $elements) .')';
+ // Get last position of the last closing markers
+ // If found, insert the link before the markers
+ if (preg_match('!(?'. $block_tags .'[^>]*>)+s*$!mi', $teaser, $match, PREG_OFFSET_CAPTURE)) {
$teaser = substr_replace($teaser, ed_readmore_link_render($node, $display), $match[0][1], 0);
}
/*