Enable optional first pass of SmatyPants with "w" set in smartypants_attributes
apostate - October 18, 2007 - 18:09
| Project: | Typogrify |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mikl |
| Status: | active |
Description
The TinyMCE editor automatically converts all double-quotes to ", If using the TinyMCE module for editing your content, which effectively disables SmartPants' smart quotes functionality. SmartPants has the ability to convert them back by including "w" in $smartypants_attributes. I've added a few lines of code to optionally enable a first run of SmartyPants. Maybe this should be in another area of the Typogrify configuration screen, though.
92a93,95
> if( variable_get("typogrify_smartypants_attributes_w", 0) ) {
> $text = SmartyPants($text, 'w');
> }
232a236,253
>
> // Advanced SmartyPants configuration
> $form['typogrify_settings']['spadvanced'] = array(
> '#type' => 'fieldset',
> '#title' => t('Advanced SmartyPants'),
> '#collapsible' => TRUE,
> '#collapsed' => TRUE,
> );
>
>
> // SmartyPants Attribute - "w" - Convert "
> $form['typogrify_settings']['spadvanced']['typogrify_smartypants_attributes_w'] = array(
> '#type' => 'checkbox',
> '#title' => t('Translates any instance of "'),
> '#default_value' => variable_get('typogrify_smartypants_attributes_w', 0),
> );
>
>
258c279
#1
Hi Apostate,
Sounds like a plan. I'll get that into the module. Thanks for the suggestion!
#2
#3
#4
Did this ever make it in? To me it seemed like maybe it would just make sense to set the $convert_quot option for all the "do everything" values of the $attr switch, as in the attached patch (note that this is against the Drupal 6 version of this module). Any problem with that? It seems to me that this matches expected behavior when you enable the smartypants quote fixing.