mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
In this commit we enhance our current template linter to detect duplicate ids and report them during lint checks. html_branches.py was topped up with a new function build_id_dict for the purpose. Also the get_tag_info function in same file was updated to parse ids and classes more robustly in cases of template variables. split_for_id_and_class function was added to serve this purpose. Unit tests for both the functions were created under tests/test_html_branches. Also a directory under tests called test_template_data was created to hold templates for testing under newly created functionality. check_templates was modified to print to console any duplicates detected. showell reviewed my commit and helped me out. Fixes #2950.
18 lines
481 B
HTML
18 lines
481 B
HTML
<!-- test -->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Test</title>
|
|
<meta charset="utf-8" />
|
|
<link rel="stylesheet" href="style.css" />
|
|
</head>
|
|
<body>
|
|
<div id="below_navbar">
|
|
<p id="intro">
|
|
<span id="hello_{{ message }}">Hello World!!</span>
|
|
This is a test file for checking correct working of duplicate id detection module.
|
|
</p>
|
|
</div>
|
|
</body>
|
|
</html>
|