-
Notifications
You must be signed in to change notification settings - Fork 319
Марченко Максим #248
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
base: master
Are you sure you want to change the base?
Марченко Максим #248
Conversation
cs/Markdown/TokenParser.cs
Outdated
| } | ||
| } | ||
|
|
||
| private IEnumerable<Token> FindParagraphTokens(string mark) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Попробуй найти в классе String метод, который поможет убрать for из этого метода
cs/Markdown/ParserValidator.cs
Outdated
| { | ||
| return !isScreened | ||
| && startIndex + markLength < _text.Length | ||
| && _text[startIndex + markLength] != ' '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У тебя учитывается только пробел, но есть еще другие пробельные символы, например tab. Используй Char.IsWhiteSpace
cs/Markdown/ParserValidator.cs
Outdated
| { | ||
| return start > 0 && _text[start - 1] != ' ' | ||
| && end < _text.Length - 1 && _text[end + 1] != ' ' | ||
| && _text.Substring(start, end - start).Contains(' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут аналогично можно вот так сделать _text.Substring(start, end - start).Any(Char.IsWhiteSpace)
Наставник @Yaroslav332
Структура
Моя идея заключается в том, что найдя все действующие "inline elements"
сохранить позиции их содержимого в Token-ы чтобы при сборке html
поочередно вставлять в StringBuilder html-тэги из токенов и исходный текст.