mirror of
https://github.com/tadad/blog.git
synced 2024-09-11 12:55:07 +03:00
md render bug fixed
This commit is contained in:
parent
d821feec79
commit
e882d40579
@ -3,17 +3,23 @@
|
||||
^- simple-payload:http
|
||||
=/ turl=tape (trip url.request)
|
||||
=/ turl-len (lent turl)
|
||||
=/ scry-path=@t
|
||||
:: TODO all the text parsing here is super ugly, might
|
||||
:: be a better way to do it, but basically just detect
|
||||
:: .md or .html, manipulate the scry-path, add
|
||||
:: proper headers, and that's it.
|
||||
=/ [content-type=@t scry-path=@t]
|
||||
=+ md=(find ".md" turl)
|
||||
?: &(?=(^ md) =((add u.md 3) turl-len))
|
||||
:- 'text/plain; charset=utf-8'
|
||||
(crip (weld "/md" (swag [0 (sub turl-len 3)] turl)))
|
||||
:- 'text/html; charset=utf-8'
|
||||
=+ html=(find ".html" turl)
|
||||
?: &(?=(^ html) =((add u.html 5) turl-len))
|
||||
(crip (weld "/html" (swag [0 (sub turl-len 5)] turl)))
|
||||
(crip (weld "/html" turl))
|
||||
::
|
||||
^- [response-header:http (unit octs)]
|
||||
:- [200 ['Content-Type' 'text/html; charset=utf-8']~]
|
||||
:- [200 ['Content-Type' content-type]~]
|
||||
%- some
|
||||
%- as-octs:mimes:html
|
||||
.^ @t %gx
|
||||
|
Loading…
Reference in New Issue
Block a user