From 58b05733c113b3f6f3e32212e50d33f9b9dc7b25 Mon Sep 17 00:00:00 2001
From: riton <riton@riton.home>
Date: Sun, 23 Mar 2025 22:38:37 +0300
Subject: =?UTF-8?q?html=20=C3=BCretiminde=20yeni=20sat=C4=B1rlar=20d=C3=BC?=
 =?UTF-8?q?zenlendi?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 html-jen.lisp | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/html-jen.lisp b/html-jen.lisp
index 4bcf680..6074888 100644
--- a/html-jen.lisp
+++ b/html-jen.lisp
@@ -11,19 +11,25 @@
 
 (defun tag-yeni-satır? (tag)
   (case tag
-    ((:html :head :body) t)
-    ((:title :p :b :i :code) nil)))
+    ((:html :head :body :div :ol :ul) t)
+    ((:title :p :b :i :code :li) nil)))
+
+(defun tag-inline? (tag)
+  (case tag
+    ((:html :head :body :div :ol :ul :li :p) nil)
+    ((:title :b :i :code) t)))
 
 (defmethod node->html :before ((node node) &optional (stream *standard-output*))
-  (loop :for i :from 0 :below *indent*
-        :do (write-char #\Space stream))
-  (setf *yeni-satır* nil)
+  (unless (not *yeni-satır*)
+    (loop :for i :from 0 :below *indent*
+          :do (write-char #\Space stream)))
   (if (null (props node))
       (format stream "<~a>" (tag node))
       (loop :initially (format stream "<~a" (tag node))
             :for (k v) :on (props node) :by #'cddr
             :do (format stream " ~a=\"~a\"" k v)
             :finally (write-char #\> stream)))
+  (setf *yeni-satır* nil)
   (when (tag-yeni-satır? (tag node))
     (write-char #\Newline stream)
     (setf *yeni-satır* t)))
@@ -36,11 +42,13 @@
               :do (node->html child stream)))))
 
 (defmethod node->html :after ((node node) &optional (stream *standard-output*))
-  (unless (null *yeni-satır*)
+  (unless (not *yeni-satır*)
     (loop :for i :from 0 :below *indent*
           :do (write-char #\Space stream)))
-  (format stream "</~a>~%" (tag node))
-  (setf *yeni-satır* t))
+  (if (tag-inline? (tag node))
+      (format stream "</~a>" (tag node))
+      (progn (format stream "</~a>~%" (tag node))
+             (setf *yeni-satır* t))))
 
 
 (defun node->cons (node)
-- 
cgit v1.2.3