Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: added setters for content property of block tokens #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mistletoe/block_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ def content(self):
"""Returns the code block content."""
return self.children[0].content

@content.setter
def content(self, value):
"""Sets the code block content."""
self.children[0].content = value

@staticmethod
def start(line):
return line.replace('\t', ' ', 1).startswith(' ')
Expand Down Expand Up @@ -429,6 +434,11 @@ def content(self):
"""Returns the code block content."""
return self.children[0].content

@content.setter
def content(self, value):
"""Sets the code block content."""
self.children[0].content = value

@classmethod
def start(cls, line):
match_obj = cls.pattern.match(line)
Expand Down Expand Up @@ -1040,6 +1050,11 @@ def content(self):
"""Returns the raw HTML content."""
return self.children[0].content

@content.setter
def content(self, value):
"""Sets the code block content."""
self.children[0].content = value

@classmethod
def start(cls, line):
stripped = line.lstrip()
Expand Down