HTML 서식 온라인 도구



정보HTML 서식 온라인 도구:

이 온라인 HTML 서식 도구는 혼란스러운 HTML 파일을 읽을 수있는 HTML 파일로 포맷하는 데 도움을줍니다.

이 도구는 입력이 공식 HTML 구문을 준수하지 않는 경우에도 잘못된 HTML 파일의 형식을 강제 지정할 수 있습니다.

comic html beautifier

HTML (Hypertext Markup Language)에 대한 추가 링크:

W3 HTML 5.2 표준: https://www.w3.org/TR/html5/

RFC 7992 (HTML): https://tools.ietf.org/html/rfc7992

파이썬의 HTML (BeautifulSoup): https://www.crummy.com/software/BeautifulSoup/

Python에서 HTML 서식 지정 (BeautifulSoup 패키지 사용):

  1. def html_beautify(input_str):
  2. input_str = BeautifulSoup(input_str, 'html.parser').prettify()
  3. result = ''
  4. indent_str = ' '
  5. for line in input_str.split('\n'):
  6. lstrip_line = line.lstrip(' ')
  7. indent_len = len(line) - len(lstrip_line)
  8. formatted_line = indent_len * indent_str + lstrip_line
  9. result = result + formatted_line + '\n'
  10. return result