I ran

drush @mir urol 'event publisher' ajt143

And it spit out

Added the <em>event publisher</em> role to uid <em>8</em>

Thinking it shouldn't have the HTML in there.

Comments

vinmassaro’s picture

I'm seeing the same output:

d7dev $ drush urol "administrator" --uid=2
Added the <em class="placeholder">administrator</em> role to uid <em class="placeholder">2</em>  

The dt() function seems to generate this, as wrapping it in strip_tags() fixes it. Are there some commands that output HTML, which is why this is in place?

greg.1.anderson’s picture

Category: feature » bug

This is because %substitutions wrap the substituted text with html tags. This is only done if there is a bootstrapped Drupal site. For example:

$ drush ev 'print(dt("Add %test", array("%test" => "html")));'
add html
$ drush @site ev 'print(dt("Add %test", array("%test" => "html")));'
Add <em>html</em>
$ drush @site ev 'print(dt("Add !test", array("!test" => "plain")));'
Add plain

The correct solution here is to find all occurrences of the dt() function that use % substitutions, and switch them to use !substitutions.

jonhattan’s picture

Status: Active » Fixed

Did proceed per #2.

Instead of strip_tags I'd like to see we #1162694: Switch from t() to gettext().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.