IMO, some filter work to help HTML posts is required before we release Drupal 4.

The current code does restricts authors to a list of allowed HTML tags and deals with carriage returns in unfortunate ways. Trying to post nicely formatted documentation in the Drupal Handbook is impossible today. We should not obstruct people who want to contribute HTML formatted documentation.

The issue has been discussed repeatedly on the drupal-dev list. Ax's most recent proposal, which seems reasonable to me, is copied below. Also see following threads for background.

A volunteer to complete this feature request is sorely needed.

---------------

1. separate html and text posts ("this post contains html" checkbox)
2. change "allowed html tags" to "prohibited html tags" (to avoid "i'd like to have tag x in the allowed list")
3. find a fixed "allowed HTML tags" list and not change it (because changing it messes up existing content).

----------------

- http://list.drupal.org/drupal-devel/2002-April/007715.html
- http://mail.zind.net/pipermail/drupal-devel/2002-January/006211.html
- http://mail.zind.net/pipermail/drupal-devel/2001-November/thread.html#2356

Comments

Anonymous’s picture

Assigned: Unassigned » Kjartan

I'm working on a RFC for filters, but this wont make the 4.0 release. Should be in 4.1. The filters have been tweaked a little before 4.0, but it still needs work.

ax’s picture

Component: Code » Node system

a new idea for comfortably marking up text (expressing it's semantic meaning) in drupal, which simultaneously solves the html markup problems:

Structured Text, http://www.zope.org/Documentation/Articles/STX

i /really/ like that!

moshe weitzman’s picture

Title: Fix HTML Posting - filter enhancement » Structured Text - filter enhancement
Assigned: Kjartan » Unassigned

I found a script which converts structured text into PHP. See http://www.keithdevens.com/software/ here is a link.

Ax - any interest in converting this script into a Drupal filter as a proof of concept? In the end, I do think this transform should happen during rendering instead of before saving into the database.

ax’s picture

I found a script which converts structured text into PHP. See http://www.keithdevens.com/software/.

Ax - any interest in converting this script into a Drupal filter as a proof of concept?

i checked that link / script and decided not to do it because of - time, and because i really dont like its syntax ("!!!!!!heading level 6" !).

this doesnt mean, however, that i don't want to help in implementing a better and easier way of authoring rich content in drupal (finally, i'm the (other ;)) one who's complaining about drupal's html-authoring capabilities). i had some looks around about the subject of Structured Text and also exchanged some mail with moshe about it. we both agree in that the way to go with respect to structured text is some kind of php implementation of reStructuredText (http://docutils.sourceforge.net/rst.html), a actively developed, "thoroughly implemented revision and reinterpretation of the StructuredText and Setext lightweight markup systems",
"Markup Syntax and Parser Component of the python Docutils" (http://docutils.sourceforge.net/index.html) project.

to find out if this (php port) is possible, i asked (http://sourceforge.net/mailarchive/forum.php?thread_id=1096153&forum_id=8812) the docutils mailing list. 10 replies so far (see there); short summary:

- there doesnt exist no php nor any other language port of reST or similar
- there is (almost) no experience / project about converting python to php
- but (lucky we are ;)) "Fortunately, the design of the docutils project is quite clean and organised", and "At a minimum, you could just implement a
parser for ReST and your own framework for generating the HTML"

which sounds somehow managable. i leave you here ... until later.

adrian’s picture

I have written a textile.module based on the textile system used in MT.

A very simple module to add.. however, to get everything working well and at optimal speed i implemented seperate pre and post filtering fields for node->teaser and node->body.

http://cvs.drupal.org/viewcvs/contributions/sandbox/adrian/?cvsroot=contrib

The trick here is, that the pre_filtered field is what the user sees when editing, and on saving the data it will run it through the filters again and then use the filtered text to display all around the site.

I am planning to add the per node filtering option through kjartan's node api soon.

I have also discussed a general regexp engine capable of emulating rSTX or any of the other systems. I have gone as far as to extract the needed regular expressions from the rSTX source.

moshe weitzman’s picture

The pre-post patch looks pretty clean to me, and might be a good short term fix for some of the perceived shortcomings of the filter() system. Comment by others is appreciated - see Adiran's sandbox.

textile.module may want to implement the new _compose_tips() hook in order to inform users of its syntax. have a look at compose_tips.module in Contrib for details.

killes@www.drop.org’s picture

Component: Node system » other

There is now a textile.module and a latex.module.
Also, the issue with allowed html has been fixed for a long time.

Anonymous’s picture

Automatically closed due to inactivity (marked fixed for 14 days).