I've put together another module for myself the handles the [caption align="right" ...] syntax properly. I'm considering contributing the code, but I think it might be better to just merge it with this module. This module would then parse either syntax.

My module is produces pure html/css. There is no jquery connected.

What do you think?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

freelock’s picture

Hi,

How about posting a patch here? In the midst of a wp-> drupal migration right now, would be great if you have this already done...

Aron Novak’s picture

Status: Active » Needs work
FileSize
9.91 KB

For everyone, who wants to use it for wp->drupal migration, here is a patch.
It uses WP's own shortcode processing file (with some cleanup, i removed non-needed functions from the file).
The help text inside the module is not updated, but i tested at wp-migrated nodes and seems to work well.
I only set this to "Needs work", as the help text is not true anymore, also including a file from WP is not so nice, not sure if it can be committed like this to the repository.

Bevan’s picture

tnichols; Where is your code available?

Aron Novak; Thanks for this! It's just what I need.

Bevan’s picture

Title: Wordpress [caption] syntax » Support WordPress [caption] syntax
FileSize
6.13 KB
3.34 KB

This version of the patch makes the CSS-width of div.caption-inner work. Without the patch, the width property's value is missing "px", and therefore has no effect. I.e. The rendered markup is now;

<div class="caption-inner" style="width: 225px;">

instead of

<div class="caption-inner" style="width: 225;">

The patch does not include shortcodes.inc, which I have also attached.

Bevan’s picture

Aron; I believe the license of the original file shortcodes.inc is GPL 2, correct? If so then I do not believe it is a problem to include it in the repository.

Though the problem really is whether the maintainer of this module (if he/she is still active) wants to change the module this radically.

Aron Novak’s picture

From http://drupal.org/node/103704
"DO NOT include code from a non-Drupal project in the repository."
So i think it's still a bit problematic to do copy-paste from another project, regardless of its license.

quicksketch’s picture

Title: Support WordPress [caption] syntax » Support WordPress [caption] syntax (implement full quicktags.inc file)

Rather than implement the entire WordPress quicktag.inc file, I think a rational first step would be just to fix the "bug" instead of working on this possibly over-reaching feature request. I've made a new issue for just the bug at #1282088: WordPress-style [align="right"] quote syntax not handled correctly.

quicksketch’s picture

Status: Needs work » Closed (won't fix)

For now I'd like to table this feature. I've imitated portions of the WordPress code in the solution at #1282088: WordPress-style [align="right"] quote syntax not handled correctly. It's not lifting the entire quicktags.inc file though, which I think is a bit aggressive for this module try to shoehorn into Drupal. Instead I've only used a small segment of the code which is useful for pulling out attributes no matter what format or order they are in (e.g. attributes with or without quotes -- single or double).