Thread: Regex examples
View Single Post
Old 02-25-2014, 04:19 AM   #294
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Setting up a div container around quotes.

My converter creates paragraphs only, but not div containers.

I have a very long book to deal with, with a lot of quotes, some of them very long. I use two main paragraph styles, "bodytext" (100%) and "quote" with a smaller size.

The problem is that these quotes may include from one to four paragraphs. I would like to neatly separate the quote from the bodytext for readability purposes, but if I do it using only paragraphs, long quotes look weird because the space between paragraphs is too big. Obviously I need to enclose each quote within a div which will take care of the needed whitespace.

Say a div with bottom and top margins of 1em, while the quote paragraphs themselves will have much smaller margins (or not at all).

I can do that manually... or set up a regex. This is the question.
roger64 is offline   Reply With Quote