markdown定位问题
This commit is contained in:
parent
3453aa31eb
commit
ae9b48953e
|
@ -50,14 +50,14 @@ export default ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[url])
|
},[url,html])
|
||||||
|
|
||||||
const el = useRef();
|
const el = useRef();
|
||||||
function onAncherHandler(e) {
|
function onAncherHandler(e) {
|
||||||
let target = e.target
|
let target = e.target;
|
||||||
if (target.tagName.toUpperCase() === 'A') {
|
if (target.tagName.toUpperCase() === 'A') {
|
||||||
let ancher = target.getAttribute('href')
|
let ancher = target.getAttribute('href');
|
||||||
if (ancher.startsWith('#')) {
|
if (ancher && ancher.startsWith('#')) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let viewEl = document.getElementById(ancher.replace('#', ''))
|
let viewEl = document.getElementById(ancher.replace('#', ''))
|
||||||
if (viewEl) {
|
if (viewEl) {
|
||||||
|
|
|
@ -58,9 +58,12 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
||||||
:""
|
:""
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
{
|
||||||
|
content &&
|
||||||
<div className="commonBox-info">
|
<div className="commonBox-info">
|
||||||
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={history.location}/>
|
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={history.location}/>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue