in reply to Re^4: Most efficient way to remove some text from a string
in thread Most efficient way to remove some text from a string

"tee" the output to a file with docx extension. I want to open the file with word.</c>

A trick for producing documents that look nice in Word: output simple HTML and name the file with a docx extension. Word will format that reasonably and your employer gets a "docx" file.

You can indent - and get bullet points (or item numbers) - with HTML lists:

<ul> <li>artist <ul> <li>album <ol> <li>song</li> <li>song</li> </ol> </li> <li>album</li> </ul> </li> <li>artist</li> </ul>

Note: <ul> produces a bulleted list and <ol> produces a numbered list.

To get a list with out either bullets or numbers, use:

Update: As hippo rightly pointed out (below), you should use:

<ul style="list-style: none;">

rather than (ab)using <dl> as I have done in the past. However, I have not actually tested that, so I will leave my (heretical) example, below, as-is.

<dl> <dd>artist</dd> <dd>artist</dd> </dl>

You can nest <dl> with <ul> and <ol> lists.

Replies are listed 'Best First'.
Re^6: Most efficient way to remove some text from a string (semantic HTML)
by hippo (Archbishop) on Dec 09, 2016 at 09:35 UTC
    To get a list with out either bullets or numbers [use <dl>]

    Please don't do this. It would be misusing semantic tags for stylistic reasons which has been frowned upon since the turn of the millennium. Worst of all, it upsets Sir Tim.

    In HTML, an unordered list (which is what you have in your last example) is semantically identified by the <ul> tag. It's what the U and the L stand for: Unordered List. If you want to present this list without any markers then all you need to do is style it as such, either via CSS or a <style> tag or (simplest) with the style attribute. eg: <ul style="list-style: none;">.

    Conversely the <dl> tag is semantically for Definition Lists (or more generally for Description Lists). Since you aren't defining/describing any terms here, please don't use the tag for this.

    I know you mean well and we've all had to shudder at some point as we feed horrendous input to a broken application to please some PHB but it would be bad for someone to stumble upon this thread and think that <dl> is an acceptable way of styling a list generally.