Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions blog/page-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ slugs:

## its a wild world after all

Link to [angular](http://angular.io){:target=\_blank}

```typescript
console.log('amazing');
```
Expand Down
7 changes: 6 additions & 1 deletion cypress/integration/sampleBlog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ context('check first integration test', () => {
.should('have', 'posts');
});

it('check link to have target_blank in blog page 2', () => {
cy.visit('/blog/___UNPUBLISHED___k5nhcflm_SJwD4Z0QDrIHg1PGHo2mrfLZE8sfUsPy/');

cy.get('a[target]').should('have.attr', 'target', '_blank');
});

it('Check that the slow user mock template appears then disappears', () => {
cy.visit('/slow').reload();

cy.get('app-slow>h1').contains('Scully Not Generated');
console.log('HERE');
cy.wait(4100)
.get('app-slow>h1')
.contains('Scully Generated');
Expand Down
2 changes: 1 addition & 1 deletion projects/scullyio/ng-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scullyio/ng-lib",
"version": "0.0.21",
"version": "0.0.22",
"repository": {
"type": "GIT",
"url": "https://github.com/scullyio/scully/tree/master/projects/scullyio/ng-lib"
Expand Down
2 changes: 1 addition & 1 deletion scully/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scullyio/scully",
"version": "0.0.81",
"version": "0.0.83",
"description": "Scully CLI",
"repository": {
"type": "GIT",
Expand Down
1 change: 1 addition & 0 deletions scully/pluginManagement/systemPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ import '../routerPlugins/defaultRouterPlugin';
import '../routerPlugins/ignoredRoutePlugin';
import '../routerPlugins/jsonRoutePlugin';
import '../renderPlugins/seoHrefCompletionPlugin';
import '../renderPlugins/customMarkdownOptions';
3 changes: 2 additions & 1 deletion scully/renderPlugins/contentRenderPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {handleFile} from './content-render-utils/handleFile';
import {insertContent} from './content-render-utils/insertContent';
import {readFileAndCheckPrePublishSlug} from './content-render-utils/readFileAndCheckPrePublishSlug';
import {JSDOM} from 'jsdom';
import {customMarkdownOptions} from './customMarkdownOptions';

registerPlugin('render', 'contentFolder', contentRenderPlugin);

Expand All @@ -24,7 +25,7 @@ export async function contentRenderPlugin(html: string, route: HandledRoute) {
.split('>')[0]
.trim()
);
const additionalHTML = await handleFile(extension, fileContent);
const additionalHTML = await customMarkdownOptions(await handleFile(extension, fileContent));
const htmlWithNgAttr = addNgIdAttribute(additionalHTML, attr);
return insertContent(scullyBegin, scullyEnd, html, htmlWithNgAttr, getScript(attr));
} catch (e) {
Expand Down
8 changes: 8 additions & 0 deletions scully/renderPlugins/customMarkdownOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const customMarkdownOptions = (html: string) => {
return html.replace(/\<a[^>]*\>[^<]*\<\/a\>\{[^}]*\}/g, (val, pos) => {
const [start, rest] = val.split('{:');
const injectStr = rest.slice(0, -1);
const [initial, end] = start.split('href=');
return `${initial} ${injectStr} href=${end}`;
});
};