因此,我已经能够将存储在数据库中的内容作为HTML呈现,但是将其呈现为代码
示例
<p>Dave is a fully qualified advanced remedial massage practitioner located in the northern suburbs.</p> <p>Using a state of the art Athlegen hydraulic bench and with over 15 years experience he is one of Melbourne’s leading male masseurs, running a successful practice in Preston, using tried and effective tactile pain management techniques that actually work with a very high success rate.</p> <p>Services at a glance Full body therapeutic relaxation massage to de-stress and unwind from that busy week at work, using a variety of body butters and essential oils.</p> <p>Treatments for all sport related injuries using traditional chinese pain relief balms including cupping and bio-magnetic cupping techniques.</p> <p>Remedial massage therapies for treatment of:</p> <ul> <li>All soft tissue dysfunction.</li> <li>Musculo-skeletal alignment.</li> <li>Tension headaches.</li> <li>Neck/Backpain Conditions.</li> <li>Disc compression.</li> <li>Sciatica.</li> <li>Dance & Sport related injuries.</li> <li>Stress management.</li> </ul>
这是我的index.jade文件
doctype html
html
head
title=title
link(rel="stylesheet",href="/stylesheets/style.css",type="text/css")
body
div.container
div.top-menu
h1.page-heading=title
ul
li
a(href='/') Home
li
a(href='/about') About
li
a(href='/contact') Contact
li
a(href='/crud') CRUD
div.page-content!=main_content
需要main_content来回显/返回模板内的html代码,而不是打印出所有内容。
有人知道怎么做吗?
谢谢 罗素