Skip to content

Commit dd47183

Browse files
authored
Update termicol.py
- Fixed bug that disallowed newline printing by implementing a new tag "<nl>" to signal a newline should be printed.
1 parent 445dcd8 commit dd47183

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

termicol/termicol.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def __convertParsedContent(content: list):
133133
if 'd' in reset: decorations = []
134134
newcontent.append('\033[0m')
135135

136+
elif '<nl>' in content[i]:
137+
newcontent.append('\n')
138+
136139
elif any([True for code in __Codes['textcolor'] if code in content[i]]):
137140
color = content[i].split('=')[1].replace('>','')
138141
if color in __Colors: textColor = __createColor(__Colors[color], content[i])
@@ -196,4 +199,4 @@ def tprint(content: str, end = '\n') -> None:
196199
'''
197200
Sends content to python's print function after additional parsing and reconstructing.
198201
'''
199-
print(__convertParsedContent(__parseContent(content)), end = end)
202+
print(__convertParsedContent(__parseContent(content)), end = end)

0 commit comments

Comments
 (0)