Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mailsystem
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
9
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
mailsystem
Commits
98f0fceb
Commit
98f0fceb
authored
13 years ago
by
Bob Vincent
Browse files
Options
Downloads
Patches
Plain Diff
Update mailsystem_html_to_text
parent
0546e51f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mailsystem.module
+12
-6
12 additions, 6 deletions
mailsystem.module
with
12 additions
and
6 deletions
mailsystem.module
+
12
−
6
View file @
98f0fceb
...
...
@@ -304,11 +304,18 @@ function &mailsystem_get_classes() {
* The output will be suitable for use as 'format=flowed; delsp=yes' text
* (RFC 3676) and can be passed directly to drupal_mail() for sending.
*
* We deliberately use
LF rather than CRLF, see drupal_mail()
.
* We deliberately use
MAIL_LINE_ENDINGS rather than CRLF
.
*
* This function provides suitable alternatives for the following tags:
* <a> <em> <i> <strong> <b> <br> <p> <blockquote> <ul> <ol> <li> <dl> <dt>
* <dd> <h1> <h2> <h3> <h4> <h5> <h6> <hr>
*
* <a> <address> <b> <blockquote> <br /> <dd> <dl> <dt> <em>
* <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <ol> <p> <strong> <ul>
*
* The following tags are also handled:
*
* <del> <div> <ins> <pre> <tr>: Rendered the same as a <p> tag.
*
* <td>: A space is inserted between adjacent table cells.
*
* @param $string
* The string to be transformed.
...
...
@@ -322,7 +329,7 @@ function &mailsystem_get_classes() {
* Note: This is a corrected version of html_to_text() that hopefully will
* get included into core at some point.
*
* @see
http://drupal.org/node/299138
* @see
drupal_mail()
*/
function
mailsystem_html_to_text
(
$string
,
$allowed_tags
=
NULL
)
{
// Cache list of supported tags.
...
...
@@ -520,6 +527,5 @@ function mailsystem_html_to_text($string, $allowed_tags = NULL) {
$tag
=
!
$tag
;
}
return
$output
.
$footnotes
;
return
ltrim
(
rtrim
(
$output
.
$footnotes
,
"
\r\n
"
),
"
\r\n
"
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment