ruby-reference-manual:289
From: sheepman <sheepman@s...>
Date: Sun, 7 Jan 2007 12:35:01 +0900
Subject: [ruby-reference-manual:289] dlist output
こんにちは、sheepman です。
定義リストの出力で、
<dl>
<dt> </dt>
<dd> </dd>
</dl>
<dl>
<dt> </dt>
<dd> </dd>
</dl>
というふうに、ひとつの項目ごとに、<dl>...</dl> が現れていたので、
修正してみました。
$ svn diff lib/bitclust/rdcompiler.rb
Index: lib/bitclust/rdcompiler.rb
===================================================================
--- lib/bitclust/rdcompiler.rb (revision 1410)
+++ lib/bitclust/rdcompiler.rb (working copy)
@@ -138,15 +138,17 @@
def dlist
line '<dl>'
- @f.while_match(/\A:/) do |line|
- line dt(compile_text(line.sub(/\A:/, '').strip))
+ while @f.next? and /\A:/ =~ @f.peek
+ @f.while_match(/\A:/) do |line|
+ line dt(compile_text(line.sub(/\A:/, '').strip))
+ end
+ line '<dd>'
+ # FIXME: allow nested pre??
+ @f.while_match(/\A(?:\s|\z)/) do |line|
+ line compile_text(line.strip)
+ end
+ line '</dd>'
end
- line '<dd>'
-# FIXME: allow nested pre??
- @f.while_match(/\A(?:\s|\z)/) do |line|
- line compile_text(line.strip)
- end
- line '</dd>'
line '</dl>'
end
--
sheepman / TAMURA Takashi
sheepman@s...
--
ML: ruby-reference-manual@m...
使い方: http://QuickML.com/
-> 289 2007-01-07 04:35 [sheepman@s... ] dlist output 295 2007-01-07 06:47 ┗[aamine@l... ]