How to indent a line after <br />

T

tintagel

Hi everyone, I've just joined your group!

I'm pretty new to HTML etc. Here's my problem:

I'm attached to the idea of keeping content separate from formatting
information, so I like putting content in a .xml document and then
making a stylesheet for it.

At the moment I'm working on a lot of prose-style text, and having to
enclose everything in double-sided <xyz></xyz> tags in order to get any
kind of indentation between blocks is not so convenient. This is
especially true when formatting dialogue in fiction, where you need
line breaks and indentation for lots of very short, consecutive lines
of text.

The approach I'm currently pursuing is to put an emtpy node called <br
/> in the .xml source where I need a line break, and then use .xsl and
..css stylesheets to instuct the browser to interpret this as "do a line
break, but indent the first character of the next line".

The only way to do this that I've currently found is a rather inelegant
'cheat' using the zero width non-joiner &zwnj; (‌), thus
(extracting from the stylesheet):

<xsl:template match="br">
<br />
<span id="indent">&zwnj;</span>
</xsl:template>

where "indent" pads on the left by 1em.

(De-confuser: the matched "br" is the empty node that lives in the .xml
source.)

This works o.k., and doesn't upset the "text-align: justify" which is
in effect throughout the document (and which for example, if I
substitute the <span></span> expression with &emsp, leaves the indented
text misaligned as the space character is factored into the
justification). I guess it's an o.k. work-around, but it's still a
misuse of an entity (&zwnj;), which can't be good practice and leaves a
bitter taste in the mouth.

Is there a way of achieving the same result in a more concrete manner
using CSS? Or is there a safer 'placeholder entity' I can use instead
of &zwnj; to put inside the <span> so it actually indents the following
character? A crucial consideration here seems to be the justified text,
and how to avoid mucking it up.

I'd really appreciate any advice on this!

Best wishes,

T.
 
A

Alan Cole

tintagel said:
Hi everyone, I've just joined your group!

I'm pretty new to HTML etc. Here's my problem:

I'm attached to the idea of keeping content separate from formatting
information, so I like putting content in a .xml document and then
making a stylesheet for it.

At the moment I'm working on a lot of prose-style text, and having to
enclose everything in double-sided <xyz></xyz> tags in order to get any
kind of indentation between blocks is not so convenient. This is
especially true when formatting dialogue in fiction, where you need
line breaks and indentation for lots of very short, consecutive lines
of text.

The approach I'm currently pursuing is to put an emtpy node called <br
/> in the .xml source where I need a line break, and then use .xsl and
.css stylesheets to instuct the browser to interpret this as "do a line
break, but indent the first character of the next line".

The only way to do this that I've currently found is a rather inelegant
'cheat' using the zero width non-joiner &zwnj; (‌), thus
(extracting from the stylesheet):

<xsl:template match="br">
<br />
<span id="indent">&zwnj;</span>
</xsl:template>

where "indent" pads on the left by 1em.

(De-confuser: the matched "br" is the empty node that lives in the .xml
source.)

This works o.k., and doesn't upset the "text-align: justify" which is
in effect throughout the document (and which for example, if I
substitute the <span></span> expression with &emsp, leaves the indented
text misaligned as the space character is factored into the
justification). I guess it's an o.k. work-around, but it's still a
misuse of an entity (&zwnj;), which can't be good practice and leaves a
bitter taste in the mouth.

Is there a way of achieving the same result in a more concrete manner
using CSS? Or is there a safer 'placeholder entity' I can use instead
of &zwnj; to put inside the <span> so it actually indents the following
character? A crucial consideration here seems to be the justified text,
and how to avoid mucking it up.

I'd really appreciate any advice on this!

Best wishes,

T.

I'm probably missing something here, but wouldn't it be simpler to
replace the <br />tag with </p><p> and then simply indent the first line
of the paragraph??

Al.
 
N

nice.guy.nige

While the city slept, tintagel ([email protected]) feverishly typed...

[...]
At the moment I'm working on a lot of prose-style text, and having to
[...]

The approach I'm currently pursuing is to put an emtpy node called <br
/> in the .xml source where I need a line break, and then use .xsl and

You have to think about what you are creating. Prose is a collection of
paragraphs, not text separated by line breaks. Therefore, use the <p>
element, and style it so that the first line is indented.

Cheers,
Nige
 
T

tintagel

Hello Andy,

I don't quite follow you. As far as I'm aware (and intended), I made
one post to this group on this topic. I made the same post to other
groups which looked promising, in order to cast the net as wide as
possible.
Then don't multi-post into it. Cross-post if you have to

Feeling welcome already. Is that the way you talk to people
face-to-face?
 
T

tintagel

Thanks for your reply. <p>'s requiring a closing tag is an
inconvenience. I'm looking for a way of achieving the same result with
a single, empty tag in xml.

Cheers,

T
 
T

tintagel

Hello again Andy,

I've just spotted that you made a helpful reply to the same question I
posted to another group, for which I owe you thanks. I presume
therefore that what you meant by, 'Then don't multi-post into it.
Cross-post if you have to,' is that I shouldn't have posted the same
message to different groups. Fair point if 'multi-posting' causes
problems, but I don't know how to do 'cross-post'.

T
 
J

Jonathan N. Little

tintagel said:
Hello again Andy,

I've just spotted that you made a helpful reply to the same question I
posted to another group, for which I owe you thanks. I presume
therefore that what you meant by, 'Then don't multi-post into it.
Cross-post if you have to,' is that I shouldn't have posted the same
message to different groups. Fair point if 'multi-posting' causes
problems, but I don't know how to do 'cross-post'.

T
XPosting is posting one message ONCE with more than one group listed in
the T0 field as opposed to posting the message in one group then again
in another....
 
B

Beauregard T. Shagnasty

You probably can't cross-post, using the Google Groups web interface to
Usenet. (You do know this is Usenet, and not a web site, correct?) Does
your ISP offer you NNTP News service? If so, sign up and get a real news
reader to access it.
XPosting is posting one message ONCE with more than one group listed
in the T0 field as opposed to posting the message in one group then
again in another....

And the why not to multi-post:

http://oakroadsystems.com/genl/unice.htm#xpost
 
N

Nick Theodorakis

Beauregard T. Shagnasty wrote:

[...]
You probably can't cross-post, using the Google Groups web interface to
Usenet. ...


Yes, you can. It's not that difficult, even with google groups.

Nick
 
J

Jonathan N. Little

Beauregard said:
Jonathan N. Little wrote:




You probably can't cross-post, using the Google Groups web interface to
Usenet. (You do know this is Usenet, and not a web site, correct?) Does
your ISP offer you NNTP News service? If so, sign up and get a real news
reader to access it.

I've personally only use GG to view messages on occasion, but all
posting I have done was via NNTP except for DejaNews long ago. The GG UI
must really suck.
 
B

Beauregard T. Shagnasty

Nick said:
Beauregard T. Shagnasty wrote:

[...]
You probably can't cross-post, using the Google Groups web interface to
Usenet. ...

Yes, you can. It's not that difficult, even with google groups.

Is there a page citing how to do that, which everyone could use to tell
the GGers how? (I don't use GG.) Something like safalra's quoting page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top