Skip to content

Шагов Владислав#268

Open
ShagovVladislav wants to merge 12 commits intokontur-courses:masterfrom
ShagovVladislav:master
Open

Шагов Владислав#268
ShagovVladislav wants to merge 12 commits intokontur-courses:masterfrom
ShagovVladislav:master

Conversation

@ShagovVladislav
Copy link

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Про именование - "В fork-е этого репозитория создай проект Markdown и реализуй метод Render класса Md." То, что ты решил назвать по-своему не грубая ошибка, но усложняет проверку.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Класс переименовал, а метод нет, хотя я подчеркнул, что это усложняет проверку.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tokenizer, text-parser и renderer предлагаю вынести в конструктор - либо принимай их там в качестве аргументов и один раз сохраняй в полях класса, либо создавай прямо в конструкторе; иначе получается, что на каждый вызов метода ты заново создаёшь экземпляры классов и повышаешь трафик памяти; дополнительно в токенайзере написал про это

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот тест-кейс есть в следующем тесте.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Некорректно работает с кейсом "#################################"
  2. Некорректно работает с кейсом "\##Heading"

Copy link
Author

@ShagovVladislav ShagovVladislav Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 не соглашусь, если просто "##############" то "", если "##############Heading" то "<h6>Heading</h6>"
установлено ограничение на 6 уровней заголовка, если исправлять, то мне кажется лучше в документации указать просто, что в HTML только 6 уровней заголовков.
2 в данном случае должно вывестись <p>#</p>\n<h1>Heading</h1>? или же <p>##Heading</p>? в спецификации не указан такой случай из-за отсутствия многоуровневых заголовков, смею предположить что первый вариант выглядит логичнее, но при этом ломает представление, тк заголовок и параграф не должны быть в одной строке.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обсудили в телеге

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Здесь и в других тестах ненужная "@".
  2. В этом тесте много кейсов, подумай, как следует.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Некорректно работает с немного другим кейсом "__ __" (именно двойные подчёркивания).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 вижу странный результат, как в таком случае должны обрабатываться эти подчёркивания? обрабатываться просто как подчёркивания?
в спецификации два кейса:
1 За подчерками, начинающими выделение, должен следовать непробельный символ. Иначе эти_ подчерки_ не считаются выделением
и остаются просто символами подчерка.
2 Если внутри подчерков пустая строка ____, то они остаются символами подчерка.
но строка вроде и не пустая, но при этом с пробелами частично, что и выдаёт результат "_ __"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обсудили в телеге

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Объедини с другими кейсами про заголовки или с другими кейсами про экранирование.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чет много места между тестами




[Test]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Некорректно работает с кейсом _Italic Heading\\\\_ - я здесь экранирую слэш, значит, должно вернуться Italic Heading\, так?


content.Should().Be("<p>#Start</p>");
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Некорректно работает кейс "\\" - символ экранирования должен исчезать, только если экранирует что-то, не правда ли?
  2. Подумай о случаях, когда вложенность экранирования больше 1-2 символов.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отсутствует перфоманс-тест.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Работает с кейсом "_he_ll_", но почему-то не работает с кейсом "_._._".

public TokenType Type { get; }
public string Value { get; }

public Token(TokenType type, string value = "")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, только конструктор приватный надо было сделать.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments