Skip to content

Build with baseHref removes opening tag of the next HTML element #18381

Closed
@zygimantas

Description

@zygimantas

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Not sure.

Description

ng build produces invalid HTML

🔬 Minimal Reproduction

  1. Add <base href="https://github.com/" /></head> to index.html. There should be no space between closing and opening tags (I run HTML minification before the build step)
  2. Use i18n (I am not sure if this is necessary)
  3. Run ng build --localize

🔥 Exception or Error

Updated index.html has: <base href="https://github.com/app/en/">/head>
instead of <base href="https://github.com/app/en/"></head>

🌍 Your Environment




Angular CLI: 10.0.4
Node: 14.4.0
OS: win32 x64

Angular: 10.0.5
... animations, common, compiler, compiler-cli, core
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: 

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.4
@angular-devkit/build-angular     0.1000.4
@angular-devkit/build-optimizer   0.1000.4
@angular-devkit/build-webpack     0.1000.4
@angular-devkit/core              10.0.4
@angular-devkit/schematics        10.0.4
@angular/cli                      10.0.4
@angular/pwa                      0.1000.4
@ngtools/webpack                  10.0.4
@schematics/angular               10.0.4
@schematics/update                0.1000.4
rxjs                              6.6.0
typescript                        3.9.7
webpack                           4.44.0

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions