카테고리 없음

nodejs ejs 띄여쓰기 할 경우 글자 잘림

Canyi 2022. 11. 22. 11:00

몽고디비에 저장된 데이터

<!--form id, pw-->
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>editorejs입니다.</title>
        <link
            href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"
            rel="stylesheet"
            integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi"
            crossorigin="anonymous">
    </head>
    <body>
        <%- include('nav.html') %>

        <h2 class= "container mt-4"><strong>수정 페이지</strong></h2>

        <div class="container mt-3">
          <form action="/editor?_method=PUT" method="post">
            <div class="form-group">
              <label>오늘의 할일</label>
              <input type="text" name="id" style = "display:none" value= <%= post._id %>>
              <input type="text" name="title" class="form-control" value= <%= post.todo %>>
            </div><p></p>
            <div class="form-group">
              <label>날짜</label>
              <input type="text" name="date" class="form-control" value= <%= post.date %>>
            </div><p></p>
            <button type="submit" class="btn btn-outline-danger">저장</button>
          </form>
        </div>
        
        <script
            src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
            crossorigin="anonymous"></script>
    </body>
</html>

 

 

value부분을 string처리 해주기

<input type="text" name="title" class="form-control" value= '<%= post.todo %>'>