<cite> and <code> are allowed by the default filter, and drupal_html_to_text() should support them.

This is a bug report, not a feature request, IMO.

Comments

vladimir.dolgopolov’s picture

Status: Active » Needs review
StatusFileSize
new805 bytes

Hope the patch helps.

salvis’s picture

Status: Needs review » Needs work

No, this is too simple. Maybe it works for <code>, which should just be rendered as it's entered, with all spaces and newlines intact (but I suspect that it's line-wrapped), but <cite> needs to be emphasized in some way, at least with double quotes.

vladimir.dolgopolov’s picture

Status: Needs work » Needs review
StatusFileSize
new2.5 KB

The patch renders:

code - 4 spaces indent, surrounded by a newline, preserve all spaces

cite - surround by a 'sharp' symbol, e.g.

<cite>Report on Space Management</cite>, Butch Saul, 1997 -> #Report on Space Management#, Butch Saul, 1997

What we can do with a long lines in 'code' ?
I suggest add the '/' symbol at the end of each wrapped line. But maybe it is not good.

Steven’s picture

Status: Needs review » Needs work

Code tags do not preserve white space in HTML. They should be treated like any other inline tag.

vladimir.dolgopolov’s picture

Oh, it's true.

Well, how to emphasize inline code tags here?
1) You can use the %code lnline% tag to define computer code.
2) You can use the {code lnline} tag to define computer code.
3) You can use the [code lnline] tag to define computer code.
4) You can use the -code lnline- tag to define computer code.

What tag should be used for multiline code snippets, 'pre' ?

Steven’s picture

There is no HTML tag that does what people expect. Pre only preserves white space, but still requires ampersands and angles to be escaped. This is why codefilter exists.

vladimir.dolgopolov’s picture

Status: Needs work » Needs review
StatusFileSize
new1.54 KB

I've consulted with http://en.wikipedia.org/wiki/Lightweight_markup_language and have decided:

  • code rendeds into |code| (as it is used as an monospaced font mostly)
  • cite rendeds into [cite] (as cite is used for citations or references, links)

The patch provides this.

dww’s picture

Status: Needs review » Needs work

By default, every browser I've ever known renders <cite> in italics, so it seems like for consistency, we should use /cite/ just like we do for <i|em>. Also, note that you need to support attributes in these tags. See #258192: drupal_html_to_text() doesn't support <strong class="foo">

dpearcefl’s picture

Status: Needs work » Postponed (maintainer needs more info)

Does this issue exist in current D6?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Needs work

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.