chalin/code_excerpter

Default plaster comment should match the docregion tag comment

chalin opened this issue · 0 comments

Use case from toh-5/lib/app_component.dart where we put a docregion tag inside an @Component template:

// #docregion routes-and-template
@Component(
  // #enddocregion routes-and-template
  selector: 'my-app',
  // #docregion template, routes-and-template
  template: '''
    <!-- #enddocregion routes-and-template -->
    <h1>{{title}}</h1>
    <nav>
      <a [routerLink]="routes.dashboard.toUrl()"
         routerLinkActive="active">Dashboard</a>
      <a [routerLink]="routes.heroes.toUrl()"
         routerLinkActive="active">Heroes</a>
    </nav>
    <!-- #docregion routes-and-template --> 
    <router-outlet [routes]="routes.all"></router-outlet>
  ''',
  // #enddocregion template, routes-and-template
  // #docregion styleUrls
  styleUrls: ['app_component.css'],
  // #enddocregion styleUrls
  // #docregion directives
  directives: [routerDirectives],
  // #enddocregion directives
  // #docregion routes-and-template
  providers: [
    ClassProvider(HeroService),
    ClassProvider(Routes),
  ],
)
class AppComponent {
  final title = 'Tour of Heroes';
  final Routes routes;

  AppComponent(this.routes);
}