File tree 2 files changed +27
-10
lines changed
2 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -230,11 +230,11 @@ def replace_path(match):
230
230
231
231
def convert_note_tags (self , body : str ) -> str :
232
232
conversions = {
233
- r">\s*\ [!NOTE\]\s* " : "> 📘 " ,
234
- r">\s*\ [!TIP\]\s* " : "> 👍 " ,
235
- r">\s*\ [!IMPORTANT\]\s* " : "> 📘 " ,
236
- r">\s*\ [!WARNING\]\s* " : "> 🚧 " ,
237
- r">\s*\ [!CAUTION\]\s* " : "> ❗️ " ,
233
+ r"\ [!NOTE\]" : "📘 " ,
234
+ r"\ [!TIP\]" : "👍 " ,
235
+ r"\ [!IMPORTANT\]" : "📘 " ,
236
+ r"\ [!WARNING\]" : "🚧 " ,
237
+ r"\ [!CAUTION\]" : "❗️ " ,
238
238
}
239
239
240
240
for old , new in conversions .items ():
Original file line number Diff line number Diff line change @@ -429,7 +429,24 @@ def test_correct_image_locations_no_repo_env(self):
429
429
str (context .exception ), "IMAGE_PATH environment variable not set"
430
430
)
431
431
432
- def test_convert_note_tags (self ):
432
+ def test_convert_note_tags_with_link (self ):
433
+ input_text = """
434
+ > [!NOTE]
435
+ > You can find our code at https://github.com/thousandbrainsproject/tbp.monty
436
+ >
437
+ > This is our open-source repository. We call it **Monty** after
438
+ """
439
+
440
+ expected_output = """
441
+ > 📘
442
+ > You can find our code at https://github.com/thousandbrainsproject/tbp.monty
443
+ >
444
+ > This is our open-source repository. We call it **Monty** after
445
+ """
446
+
447
+ self .assertEqual (
448
+ self .readme .convert_note_tags (input_text ).strip (), expected_output .strip ()
449
+ )
433
450
input_text = """
434
451
> [!NOTE] This is a note.
435
452
> [!TIP] Here's a tip.
@@ -439,10 +456,10 @@ def test_convert_note_tags(self):
439
456
"""
440
457
441
458
expected_output = """
442
- > 📘 This is a note.
443
- > 👍 Here's a tip.
444
- > 📘 This is important.
445
- > 🚧 This is a warning.
459
+ > 📘 This is a note.
460
+ > 👍 Here's a tip.
461
+ > 📘 This is important.
462
+ > 🚧 This is a warning.
446
463
> ❗️ Be cautious!
447
464
"""
448
465
You can’t perform that action at this time.
0 commit comments