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

Refactor baseUrl into variablePreprocessor #1239

Merged
merged 2 commits into from
Jun 26, 2020

Commits on Jun 25, 2020

  1. Refactor baseUrl into variablePreprocessor

    BaseUrl processing is done in a separate stage involving repeated and
    recursive parsing / rendering of the content.
    
    This decreases cohesiveness of variable processing, and also
    performance due to the repeated parsing and rendering.
    It also necessitates edge-case solutions such as that in MarkBind#1088 when we
    need to resolve the baseUrl before the resolveBaseUrl stage has been
    reached.
    
    With a framework for variable processing now, let's move baseUrl
    processing into it, solving the above said problems.
    
    Furthermore, rendering of other variables containing html is dependent
    on the extra htmlparser call in resolveBaseUrl.
    
    Let's formally remove the need for this by using only the unescaped
    nunjucks environment to render variables.
    ang-zeyu committed Jun 25, 2020
    Configuration menu
    Copy the full SHA
    a633690 View commit details
    Browse the repository at this point in the history
  2. Remove xmlMode reliance

    Markbind relies on xmlMode parsing of htmlparser2 to parse 'custom self
    closing tags' such as '<panel />', and avoid the auto lower case
    conversion of attribute names.
    
    This introduces very tight coupling between the order and variations of
    this option across html rendering and parsing calls.
    
    In addition, xmlMode is not compliant with various html specs, such as
    opening tags being able to act as closing tags in certain cases, or
    more common cases like erroneously expanding <br> into <br>...</br>.
    
    Let's use htmlparser2's recognizeSelfClosing tag and
    lowerCaseAttributeName options to do the same instead.
    ang-zeyu committed Jun 25, 2020
    Configuration menu
    Copy the full SHA
    ca8b330 View commit details
    Browse the repository at this point in the history