• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

earwig / mwparserfromhell / 15949141982

28 Jun 2025 11:18PM UTC coverage: 98.886% (-0.3%) from 99.204%
15949141982

push

github

earwig
Fix a failing test

3106 of 3141 relevant lines covered (98.89%)

9.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/src/mwparserfromhell/nodes/comment.py
1
# Copyright (C) 2012-2025 Ben Kurtovic <ben.kurtovic@gmail.com>
2
#
3
# Permission is hereby granted, free of charge, to any person obtaining a copy
4
# of this software and associated documentation files (the "Software"), to deal
5
# in the Software without restriction, including without limitation the rights
6
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
# copies of the Software, and to permit persons to whom the Software is
8
# furnished to do so, subject to the following conditions:
9
#
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
12
#
13
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
# SOFTWARE.
20

21
from __future__ import annotations
10✔
22

23
from typing import TYPE_CHECKING, Any
10✔
24

25
from ._base import Node
10✔
26

27
if TYPE_CHECKING:
10✔
28
    from ..wikicode import Wikicode
×
29

30
__all__ = ["Comment"]
10✔
31

32

33
class Comment(Node):
10✔
34
    """Represents a hidden HTML comment, like ``<!-- foobar -->``."""
35

36
    def __init__(self, contents: Wikicode | str):
10✔
37
        super().__init__()
10✔
38
        self.contents = contents
10✔
39

40
    def __str__(self) -> str:
10✔
41
        return "<!--" + self.contents + "-->"
10✔
42

43
    @property
10✔
44
    def contents(self) -> str:
10✔
45
        """The hidden text contained between ``<!--`` and ``-->``."""
46
        return self._contents
10✔
47

48
    @contents.setter
10✔
49
    def contents(self, value: Any) -> None:
10✔
50
        self._contents = str(value)
10✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc