Input Filter Module for mdash: Does it Exist?

View: New views
4 Messages — Rating Filter:   Alert me  

Input Filter Module for mdash: Does it Exist?

by Shai Gluskin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey folks,

On one of my sites there is an editor who loves putting in parenthetical phrases in his sentences using what should be an mdash. But instead he uses a single, double or even a triple hyphen, sometimes surrounded by spaces, sometimes not. I want to train him to use a double hyphen that I want to replace with an mdash (—) via an input filter.

Does something like that exist?

FYI to clean up old content I'm going to use the scanner module which looks great. If I find or write an input filter for the mdash, it's likely that when I clean up the old content, I'll just make the double hyphen presentation consistent and not actually put the character entity code in the database.

Shai
Content2zero

_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting

Re: Input Filter Module for mdash: Does it Exist?

by Matt Chapman-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Filter modules are very easy to write:

http://api.drupal.org/api/drupal/developer--examples--filter_example.module/6

If you're looking for someone to do it for you, I'd do it for USD$100.

Best,

Matt


Shai Gluskin wrote:

> Hey folks,
>
> On one of my sites there is an editor who loves putting in
> parenthetical phrases in his sentences using what should be an mdash.
> But instead he uses a single, double or even a triple hyphen,
> sometimes surrounded by spaces, sometimes not. I want to train him to
> use a double hyphen that I want to replace with an mdash (—) via
> an input filter.
>
> Does something like that exist?
>
> FYI to clean up old content I'm going to use the scanner module
> <http://drupal.org/project/scanner> which looks great. If I find or
> write an input filter for the mdash, it's likely that when I clean up
> the old content, I'll just make the double hyphen presentation
> consistent and not actually put the character entity code in the database.
>
> Shai
> Content2zero <http://content2zero.com>
> ------------------------------------------------------------------------
>
> _______________________________________________
> consulting mailing list
> consulting@...
> http://lists.drupal.org/mailman/listinfo/consulting
>  
_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting

Re: Input Filter Module for mdash: Does it Exist?

by Owen Barton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Shai,

I believe http://drupal.org/project/typogrify does exactly what you are looking for - it uses smartypants, and can create either en or em dashes depending on the number of hyphens and configuration.

Thanks!
- Owen

On Wed, Sep 30, 2009 at 10:53 AM, Shai Gluskin <shai@...> wrote:
Hey folks,

On one of my sites there is an editor who loves putting in parenthetical phrases in his sentences using what should be an mdash. But instead he uses a single, double or even a triple hyphen, sometimes surrounded by spaces, sometimes not. I want to train him to use a double hyphen that I want to replace with an mdash (&mdash;) via an input filter.

Does something like that exist?

FYI to clean up old content I'm going to use the scanner module which looks great. If I find or write an input filter for the mdash, it's likely that when I clean up the old content, I'll just make the double hyphen presentation consistent and not actually put the character entity code in the database.

Shai
Content2zero

_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting



_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting

Re: Input Filter Module for mdash: Does it Exist?

by Sam Cohen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I didn't know about typogriphy module, but if that doesn't work for you, you can always run the content through a str_replace in template php, replacing all -- or --- with &mdash;

Sam

On Wed, Sep 30, 2009 at 2:55 PM, Owen Barton <drupal@...> wrote:
Hi Shai,

I believe http://drupal.org/project/typogrify does exactly what you are looking for - it uses smartypants, and can create either en or em dashes depending on the number of hyphens and configuration.

Thanks!
- Owen

On Wed, Sep 30, 2009 at 10:53 AM, Shai Gluskin <shai@...> wrote:
Hey folks,

On one of my sites there is an editor who loves putting in parenthetical phrases in his sentences using what should be an mdash. But instead he uses a single, double or even a triple hyphen, sometimes surrounded by spaces, sometimes not. I want to train him to use a double hyphen that I want to replace with an mdash (&mdash;) via an input filter.

Does something like that exist?

FYI to clean up old content I'm going to use the scanner module which looks great. If I find or write an input filter for the mdash, it's likely that when I clean up the old content, I'll just make the double hyphen presentation consistent and not actually put the character entity code in the database.

Shai
Content2zero

_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting



_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting



_______________________________________________
consulting mailing list
consulting@...
http://lists.drupal.org/mailman/listinfo/consulting