summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-15 18:02:52 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-15 18:02:52 +0000
commitd80d2d6e2df3230cceeb377169daac93e3e5b494 (patch)
treed1c836c7892fafb3445ca113a0aab65e6d204c74
parent6f48727a9a7fad16334a37d84defd4ea492830f6 (diff)
downloadbrdo-d80d2d6e2df3230cceeb377169daac93e3e5b494.tar.gz
brdo-d80d2d6e2df3230cceeb377169daac93e3e5b494.tar.bz2
- Patch #8477 by Goba: fixes issues of newline handling in filters, unifying what newline should a filter expect, and fixes the missing title filter tip issue.
-rw-r--r--modules/filter.module6
-rw-r--r--modules/filter/filter.module6
-rw-r--r--modules/title.module10
3 files changed, 17 insertions, 5 deletions
diff --git a/modules/filter.module b/modules/filter.module
index 0221d35e7..f83f2eb14 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -149,6 +149,12 @@ function filter_list($force = 0) {
*/
function check_output($text) {
if (isset($text)) {
+
+ // Convert all Windows and Mac newlines to a single newline,
+ // so filters only need to deal with this one
+ $text = str_replace(array("\r\n", "\r"), "\n", $text);
+
+ // Get complete list of filters ordered properly
$filters = filter_list();
// Give filters the chance to escape HTML-like data such as code or formulas.
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 0221d35e7..f83f2eb14 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -149,6 +149,12 @@ function filter_list($force = 0) {
*/
function check_output($text) {
if (isset($text)) {
+
+ // Convert all Windows and Mac newlines to a single newline,
+ // so filters only need to deal with this one
+ $text = str_replace(array("\r\n", "\r"), "\n", $text);
+
+ // Get complete list of filters ordered properly
$filters = filter_list();
// Give filters the chance to escape HTML-like data such as code or formulas.
diff --git a/modules/title.module b/modules/title.module
index 35907241a..78b7177c4 100644
--- a/modules/title.module
+++ b/modules/title.module
@@ -8,6 +8,10 @@ function title_help($section) {
switch ($section) {
case 'admin/system/modules#description':
return t('Enables users to link to stories, articles or similar content by title.');
+ case 'filter#short-tip' :
+ return t('<a href=\"%title-help\">Link to content</a> on this site using <em>[title|text]</em>.', array("%title-help" => url('filter/tips', NULL, 'filter-title')));
+ case 'filter#long-tip' :
+ return '<p>' . t('You may quickly link to content on the site using this syntax: <em>[title|text]</em>. This will generate a link labeled "text" to the content with the title "title". If you omit "|text", the label becomes "title".') . '</p>';
}
}
@@ -63,7 +67,7 @@ function title_page($query) {
/**
* Implementation of hook_filter().
*/
-function title_filter($op, $text = '') {
+function title_filter($op, $text = '', $node = NULL) {
switch ($op) {
case 'name':
return t('Title filter');
@@ -92,8 +96,4 @@ function _title_filter_settings() {
return form_group(t('Title filter'), t('Wiki-like [node title|text] links are enabled. These shortcuts generate a link labeled "text" to the node with the title "node title". If you omit "|text", the label becomes "node title". You may use a substring of a node title if desired. When multiple matching titles are found, a list of matching nodes will be displayed. If no matching titles are found, a full-text search is returned.'));
}
-function title_compose_tips() {
- return array(t('You may quickly link to another node using this syntax: <em>[node title|text]</em>. This will generate a link labeled "text" to the node with the title "node title". If you omit "|text", the label becomes "node title".'));
-}
-
?>