File tree Expand file tree Collapse file tree
explore/section-component/grid-section Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ import {
5353} from '../../../../core/shared/operators' ;
5454import { SearchService } from '../../../../core/shared/search/search.service' ;
5555import { Site } from '../../../../core/shared/site.model' ;
56- import { hasValue } from '../../../../shared/empty.util' ;
56+ import {
57+ hasValue ,
58+ isEmpty ,
59+ } from '../../../../shared/empty.util' ;
5760import { SearchResult } from '../../../../shared/search/models/search-result.model' ;
5861import { followLink } from '../../../../shared/utils/follow-link-config.model' ;
5962import { PaginationComponentOptions } from '../../../pagination/pagination-component-options.model' ;
@@ -159,7 +162,10 @@ export class GridSectionComponent implements OnInit {
159162 this . maincontentTitle = this . maincontentTitle ?? this . translateService . instant ( 'grid.component.title' ) ;
160163 this . maincontentSubtitle = this . maincontentSubtitle ?? this . translateService . instant ( 'grid.component.subtitle' ) ;
161164 this . maincontentAbstract = this . maincontentAbstract ?? this . translateService . instant ( 'grid.component.abstract' ) ;
162- this . maincontentLink = this . maincontentLink ?? this . translateService . instant ( 'grid.component.link' ) ;
165+
166+ if ( isEmpty ( this . maincontentLink ) ) {
167+ this . maincontentLink = this . gridSection . mainContentLink ?? this . translateService . instant ( 'grid.component.link' ) ;
168+ }
163169 }
164170
165171 private getSearchResults ( ) {
Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ export class MarkdownEditorComponent {
7979 */
8080 updateContent ( content : ContentChange ) {
8181 const sanitizedContent = this . sanitizer . sanitize ( SecurityContext . HTML , content . html ) ;
82- const normalizedContent = sanitizedContent ?. replace ( / & # 1 6 0 ; / g, ' ' ) ;
82+ let normalizedContent = sanitizedContent ?. replace ( / & # 1 6 0 ; / g, ' ' ) ;
83+ // Remove outer <p>...</p> if present as quill wraps around p by default
84+ if ( normalizedContent ) {
85+ normalizedContent = normalizedContent . replace ( / ^ < p > ( [ \s \S ] * ) < \/ p > $ / i, '$1' ) ;
86+ }
8387 this . editValueChange . emit ( normalizedContent ) ;
8488 }
8589}
You can’t perform that action at this time.
0 commit comments